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

Provide helpful stack trace in WritableResourceStream #96

Closed kelunik closed 2 years ago

trowski commented 2 years ago

Personally I would pass a closure or null to the suspension to resume, e.g. static fn () => throw new ClosedException("The stream was closed by the peer");. It adds another function call to the stack trace, but the code seems less strange and Psalm should be more accepting of it.