public function isWritable() { return $this->writable; }
public function onNext($data) { if (!$this->stream->isWritable()) { throw new \Exception('Stream must be writable'); } $this->stream->write($data); }