-
Notifications
You must be signed in to change notification settings - Fork 95
Support more gRPC streaming events. #68
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
Conversation
- 'metadata' and 'status' events are meaningful and should be forwarded. - gRPC streaming results have 'cancel' method, this method call needs to be forwarded as well. Fixes googleapis#67
Current coverage is 92.23% (diff: 83.33%)@@ master #68 diff @@
==========================================
Files 9 9
Lines 993 1004 +11
Methods 148 151 +3
Messages 0 0
Branches 210 212 +2
==========================================
+ Hits 916 926 +10
- Misses 77 78 +1
Partials 0 0
|
if (this.type !== StreamType.CLIENT_STREAMING) { | ||
stream.on('data', this.emit.bind(this, 'data')); | ||
// Pushing null causes an ending process of the readable stream. | ||
stream.on('end', this.push.bind(this, null)); | ||
// This is required in case there's no 'data' handler exists. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
stream.on(event, this.emit.bind(this, event)); | ||
}.bind(this)); | ||
// We also want to supply the status data as 'response'. | ||
stream.on('status', this.emit.bind(this, 'response')); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
if (this.type !== StreamType.CLIENT_STREAMING) { | ||
stream.on('data', this.emit.bind(this, 'data')); | ||
// Pushing null causes an ending process of the readable stream. | ||
stream.on('end', this.push.bind(this, null)); | ||
// This is required in case there's no 'data' handler exists. | ||
this.resume(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
forwarded.
needs to be forwarded as well.
Fixes #67