createFromLoop() public static method

create a new default sender attached to the given event loop
public static createFromLoop ( React\EventLoop\LoopInterface $loop ) : self
$loop React\EventLoop\LoopInterface
return self
Beispiel #1
0
 public function __construct(LoopInterface $loop, Sender $sender = null, MessageFactory $messageFactory = null)
 {
     if ($sender === null) {
         $sender = Sender::createFromLoop($loop);
     }
     if ($messageFactory === null) {
         $messageFactory = new MessageFactory();
     }
     $this->sender = $sender;
     $this->loop = $loop;
     $this->messageFactory = $messageFactory;
 }
Beispiel #2
0
 public function testCreateFromLoop()
 {
     $sender = Sender::createFromLoop($this->loop);
     $this->assertInstanceOf('Clue\\React\\Buzz\\Io\\Sender', $sender);
 }