Skip to content
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

return value of reponse-starter callback passed for streaming is not defined #11

Closed
markstos opened this issue Dec 25, 2010 · 4 comments

Comments

@markstos
Copy link

The docs say this "MAY return a callback that is passed another callback (response starter) as its first argument, and pass the three element response to the callback."

The return value of the "response starter" callback does not appear to be defined. (Or perhaps there definition is in there somewhere, but needs to be clarified).

Thanks.

@miyagawa
Copy link
Member

It's explained in the very next paragraph.

@markstos
Copy link
Author

This paragraph: "Similarly, an application MAY omit the third element (the body) in the callback to get a response writer object, that implements write, poll_cb and close method to push the response body."

So, the return value is the three element response, where the third value may be omitted to become a response writer?

The return value is only implied in the definition here. It sounds like it should be: "The interior callback should return the standard three element response. An application MAY omit..."

@miyagawa
Copy link
Member

So, the return value is the three element response, where the third value may be omitted to become a response writer?

No.

@miyagawa
Copy link
Member

If the callback is given three elements, the return value of the callback is "undefined" i.e. thrown away.

If the callback is given two elements (i.e. the third element is omitted) the callback should return a writer object that implements write and close. (No poll_cb here anymore, you're reading the wrong version of the document).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants