Exemple #1
0
 /**
  * @param string $name
  * @param ChannelBaseInterface|ChannelCompositeInterface $channel
  * @return ChannelCompositeInterface
  */
 public function setBus($name, $channel)
 {
     $this->bus[$name] = $channel;
     $this->events[$name] = $channel->copyEvents($this, ['connect', 'disconnect']);
     // TODO handle start
     // TODO handle stop
     $this->events[$name][] = $channel->on('input', function ($sender, ChannelProtocolInterface $protocol) {
         $this->handleInput($sender, $protocol);
     });
     return $this;
 }