-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments on return values for PSGI streaming functions #27
Comments
This came up on irc/mailing list, and i think it makes sense to return write buffer length in the synchronous/blocking server implementations, and it is actually done so with the current version of HTTP::Server::PSGI and Starlet, while it doesn't make much sense in async implementation since there, write() is just a queue up method. I'm not sure if I like that complicated optional return value array format, i would just rather have a boolean. |
It would be useful to do some review of several servers to see what While a boolean would make for a simpler API be simpler for the Plack It also means you can't use the Plack API to see how many bytes you Anyway, I didn't mean that they would return an array, rather that it
Which is certainly a lot more verbose than:
But in the case where you actually care about getting the full |
I see what you mean but the complexity of the code checking them sounds like a sign of over complication. |
Yeah, I hate it (really I just wrote the original proposal to start I actually think in practice a better way to handle this is to
I checked out e.g. the uwsgi code and it does:
Where the write does:
I.e. returns the number of bytes written. I think any server that's So just saying:
But we'll need a variable in We can also just give suggestions for returning whatever makes sense But that brings us back to a similar discussion we had about overly Personally I lean heavily towards verbosely declaring API's up-front, |
Add comments on the proposal to optionally add meaningful return values to the streaming functions here.
The text was updated successfully, but these errors were encountered: