amphp / byte-stream

A non-blocking stream abstraction for PHP based on Amp.

Home Page:https://amphp.org/byte-stream

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplex stream

ralt opened this issue · comments

Hi,

Is it possible to have a duplex stream? A typical use case is sharing a stream and having one side reading from it, while the other is writing to it. Quite similar to Golang's channels.

Yes, you can just implement both interfaces. That's what Socket does in amphp/socket.

Do you want a class that collects all writes and spits those out to the reader again?

I'm going to close this for now. We don't see a need for a combined interface currently.