createFromLoop() 공개 정적인 메소드

create a new default sender attached to the given event loop
public static createFromLoop ( React\EventLoop\LoopInterface $loop ) : self
$loop React\EventLoop\LoopInterface
리턴 self
예제 #1
0
파일: Browser.php 프로젝트: clue/buzz-react
 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;
 }
예제 #2
0
 public function testCreateFromLoop()
 {
     $sender = Sender::createFromLoop($this->loop);
     $this->assertInstanceOf('Clue\\React\\Buzz\\Io\\Sender', $sender);
 }