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

Remove length requirement for write promises

kelunik opened this issue · comments

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.

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.

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