amphp / byte-stream

A non-blocking stream abstraction for PHP based on Amp.
https://amphp.org/byte-stream
MIT License
363 stars 31 forks source link

Rename ClosableStream to Closable and add onClose method #97

Closed trowski closed 2 years ago

trowski commented 2 years ago

This allows interested parties to be notified when a stream (or other resource, such as a server) is closed.

Added OnCloseRegistry for reuse in implementations, including those in other libraries such as amphp/socket.

trowski commented 2 years ago

Reused Future as @bwoebi suggested.