amphp / byte-stream

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

Remove length requirement for write promises #22

Closed kelunik closed 6 years ago

kelunik commented 6 years ago

Currently we resolve promises from write to the length written. I think we can remove that. That'd allow an optimization like using a singleton NullSuccess object.

trowski commented 6 years ago

The interface doesn't explicitly say that the promise is resolved with the length and I think some classes implementing the interface already resolve with null, so I see no problem here.

kelunik commented 6 years ago

Closing, as the interface doesn't require anything like that.