-
Notifications
You must be signed in to change notification settings - Fork 349
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
feat: grpc-web support promise stream #631
Conversation
Signed-off-by: Christian Stewart <[email protected]>
Signed-off-by: Christian Stewart <[email protected]>
"responsePromiseOrObservable" was changed to return the Observable type if clientStreaming is set: stephenh@d3e7f1f#r79607248 This is only the case when using grpc-web. Fixes stephenh#628 Signed-off-by: Christian Stewart <[email protected]>
const inputType = requestType(ctx, methodDesc, partialInput); | ||
params.push(code`request: ${inputType}`); | ||
// grpc-web client stream or bidirectional stream not request params when use Promise. | ||
if (!options.returnObservable && options.outputClientImpl === 'grpc-web' && methodDesc.clientStreaming) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just invert the if statement here.
if (options.returnObservable || options.outputClientImpl !== "grpc-web" || !methodDesc.clientStreaming)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"grpc-web client stream or bidirectional stream not request params when use Promise."
I can't understand this sentence, could you make it more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using the Promise
return type, the input parameter does not require the request
parameter.
In this implementation, the request
parameter is not required. Use callback
to get the relevant data stream, use the write
method to send data streams.
@luhuaei Are you still working on this? Am happy to help with getting it ready to merge. |
No description provided.