public function __construct(\Phasty\Stream\Stream $stream) { $this->stream = $stream; $stream->on("data", [$this, "onData"]); }