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

server: Handle context termination for pending callbacks. #55

Merged
merged 2 commits into from
Sep 23, 2021

Conversation

creachadair
Copy link
Owner

Prior to this change, calls pushed from the server to the client would ignore
the context passed to the Callback method. This meant that if the client did
not reply (for example, the client has no support for push calls), the callback
would block forever.

This change makes pending callbacks on the server respect the context that was
passed to the Callback method: When it ends, if the call has not yet received a
response, it is delivered an error from the context and resolved.

Update the documentation on Callback to recommend setting a timeout or deadline
on the context, in cases where the client might not reply.

Prior to this change, calls pushed from the server to the client would ignore
the context passed to the Callback method. This meant that if the client did
not reply (for example, the client has no support for push calls), the callback
would block forever.

This change makes pending callbacks on the server respect the context that was
passed to the Callback method: When it ends, if the call has not yet received a
response, it is delivered an error from the context and resolved.

Update the documentation on Callback to recommend setting a timeout or deadline
on the context, in cases where the client might not reply.
@creachadair creachadair self-assigned this Sep 23, 2021
@creachadair creachadair merged commit 7c55216 into default Sep 23, 2021
@creachadair creachadair deleted the callback-timeout branch September 23, 2021 18:57
creachadair added a commit that referenced this pull request Sep 23, 2021
- 7c55216 server: Handle context termination for pending callbacks. (#55)
- a051a3b cleanup: Rename tests to make it more clear what is being tested.
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

Successfully merging this pull request may close these issues.

1 participant