Register a listener to be notified when a stream is ready to write.
public addWriteStream ( resource $stream, callable $listener ) | ||
$stream | resource | |
$listener | callable |
/** * Send message. * * @param string $message * @return bool */ public function send($message) { if ($this->closed) { return false; } $this->messages[] = $message; if (!$this->listening) { $this->listening = true; $this->loop->addWriteStream($this->fd, $this->writeListener); } return true; }
/** * @override * @inheritDoc */ public function addWriteStream($stream, callable $listener) { $this->loop->addWriteStream($stream, $listener); }