addReadStream() публичный Метод

Register a listener to be notified when a stream is ready to read.
public addReadStream ( resource $stream, callable $listener )
$stream resource
$listener callable
Пример #1
0
 /**
  * @override
  * @inheritDoc
  */
 public function addReadStream($stream, callable $listener)
 {
     $this->loop->addReadStream($stream, $listener);
 }
Пример #2
0
 /**
  * @dataProvider loopsProvider
  * @param LoopExtendedInterface|LoopModelInterface|mixed $loop
  */
 public function testApiFlush_FlushesAllHandlers_WhenAllFlagSetToTrue($loop)
 {
     $stream = $this->createStream();
     $loop->onAfterTick($this->expectCallableNever());
     $loop->onBeforeTick($this->expectCallableNever());
     $loop->addWriteStream($stream, $this->expectCallableNever());
     $loop->addReadStream($stream, $this->expectCallableNever());
     $loop->erase(true);
     $loop->tick();
     unset($stream);
     unset($loop);
 }