public function addWriteStream($stream, callable $listener)
    {
        $this->emit('addWriteStream', [$stream, $listener]);
        $this->loop->addWriteStream($stream, function ($stream) use ($listener) {
            $this->emit('writeStreamTick', [$stream, $listener]);
            $listener($stream, $this);
        });
    }
public function addWriteStream($stream, callable $listener)
    {
        $this->emit('addWriteStream', [$stream, $listener]);
        $this->loop->addWriteStream($stream, function ($stream) use ($listener) {
            $this->emit('writeStreamTick', [$stream, $listener]);
            $listener($stream, $this);
        });
    }
public function addWriteStream ( $ stream , callable $ listener ) { $ this -> emit ( 'addWriteStream' , [ $ stream , $ listener ] ) ; $ this -> loop -> addWriteStream ( $ stream , function ( $ stream ) use ( $ listener ) { $ this -> emit ( 'writeStreamTick' , [ $ stream , $ listener ] ) ; $ listener ( $ stream , $ this ) ; } ) ; }
Register a listener to be notified when a stream is ready to write.

@param stream   $stream   The PHP stream resource to check.
@param callable $listener Invoked when the stream is ready.
Register a listener to be notified when a stream is ready to write .