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

Allow Client side Grpc stream cancellation #773

Closed
micmro opened this issue Jun 8, 2018 · 5 comments
Closed

Allow Client side Grpc stream cancellation #773

micmro opened this issue Jun 8, 2018 · 5 comments

Comments

@micmro
Copy link
Contributor

micmro commented Jun 8, 2018

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When a connected ClientGrpcProxy unsubscribes the Observable returned for an stream gRPC method the upstream connection stays untouched and the server continuous to send updates, even if no-one's listening.

Expected behavior

When the client unsubscribes it calls cancel() on the ClientReadableStream which triggers a cancelled event on the ServerWritableStream - receiving this ServerGrpc stops consuming it's Observable, so upstream Observables can react to this.

cancel() causes the server to return a 1 CANCELLED: Cancelled error, which should not be propagated, as the cancellation was initiated by user-code on the ClientGrpcProxy side.

Minimal reproduction of the problem with instructions

N/A

What is the motivation / use case for changing the behavior?

Having an reactive upstream polling ServerGrpc that only stops polling when the client diconnects

Environment


Nest version: 5.0.1
 
For Tooling issues:
- Node version: 8.9.4
- Platform:  Mac
@micmro micmro mentioned this issue Jun 8, 2018
3 tasks
@micmro
Copy link
Contributor Author

micmro commented Jun 11, 2018

I've setup a PR with an implementation and tests. Please let me know if you have any questions/feedback.

@kamilmysliwiec
Copy link
Member

PR has been merged. This feature will be available soon

@micmro
Copy link
Contributor Author

micmro commented Jun 22, 2018

Great. Thanks a lot!

@kamilmysliwiec
Copy link
Member

Added in v5.1.0

@lock
Copy link

lock bot commented Sep 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants