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 |
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; }
public function testCreateFromLoop() { $sender = Sender::createFromLoop($this->loop); $this->assertInstanceOf('Clue\\React\\Buzz\\Io\\Sender', $sender); }