Bravo3\Orm\Tests\Drivers\Redis\DummyPubSubDriver::setChannel PHP Method

setChannel() public method

public setChannel ( $channel )
    public function setChannel($channel)
    {
        $this->channel = $channel;
    }

Usage Example

Beispiel #1
0
 public function testPubSubMultipleChannelsAndListeners()
 {
     // Driver config 1
     $this->dummy_driver->setMessage('event-message');
     $this->dummy_driver->setChannel('unittest');
     // First set of listeners on 'unittest' channel
     $this->pubsub_manager->addListener('unittest', [$this, 'pubSubListener_1']);
     $this->pubsub_manager->addListener('unittest', [$this, 'pubSubListener_2']);
     // Driver config 2
     $this->dummy_driver->setMessage('dummy-task');
     $this->dummy_driver->setChannel('dummy');
     // Second set of listeners on 'dummy' channel
     $this->pubsub_manager->addListener('dummy', [$this, 'pubSubListener_3']);
     $this->pubsub_manager->run();
 }