public function pipe(WritableStreamInterface $dest, array $options = [])
{
Util::pipe($this, $dest, $options);
return $dest;
}
protected function saveTo() { $saveTo = $this->options['sink']; $writeStream = fopen($saveTo, 'w'); stream_set_blocking($writeStream, 0); $saveToStream = new ReactStream($writeStream, $this->loop); $saveToStream->on('end', function () { $this->onEnd(); }); $this->httpResponse->pipe($saveToStream); }