本文整理汇总了PHP中React\EventLoop\LoopInterface::removeStream方法的典型用法代码示例。如果您正苦于以下问题:PHP LoopInterface::removeStream方法的具体用法?PHP LoopInterface::removeStream怎么用?PHP LoopInterface::removeStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类React\EventLoop\LoopInterface
的用法示例。
在下文中一共展示了LoopInterface::removeStream方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRunWaitsForFutureTickEvents
public function testRunWaitsForFutureTickEvents()
{
$stream = $this->createStream();
$this->loop->addWriteStream($stream, function () use($stream) {
$this->loop->removeStream($stream);
$this->loop->futureTick(function () {
echo 'future-tick' . PHP_EOL;
});
});
$this->expectOutputString('future-tick' . PHP_EOL);
$this->loop->run();
}
示例2: close
public function close()
{
if ($this->closed) {
return;
}
$this->emit('end', array($this));
$this->loop->removeStream($this->fileDescriptor);
$this->buffer->removeAllListeners();
$this->removeAllListeners();
unset($this->socket);
$this->closed = true;
}
示例3: removeStream
/**
* Remove all listeners for the given stream.
*
* @param stream $stream The PHP stream resource.
*/
public function removeStream($stream)
{
$this->emit('removeStream', [$stream]);
$this->loop->removeStream($stream);
}
示例4: shutdown
public function shutdown()
{
$this->loop->removeStream($this->master);
fclose($this->master);
$this->removeAllListeners();
}