本文整理匯總了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();
}