-
Notifications
You must be signed in to change notification settings - Fork 618
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
Asynchronous operations in client interceptor onReceiveMetadata
is not finished by the time the GRPC call is finished
#1984
Comments
I have published #1986 in version 1.4.4, so this should be fixed now. |
Does this mean I can use
What about |
Yes, you can do async operations in all 3 events, and the surface level call will see them happen in order. The |
I see. Just to clarify, surface level call refers unary calls and streaming calls? |
Yes, I meant the surface API objects returned by method calls that represent both unary and streaming calls. |
Problem description
I'm using the
onReceiveMetadata
defined here https://github.com/grpc/proposal/blob/master/L5-node-client-interceptors.md in order to do some filesystem operations at the end of each GRPC Call.The problem is that my filesystem operations are asynchronous, they are not synchronous calls.
This means that the rest of
onReceiveMetadata
operations only completes long after I've already finished the GRPC call.Is there anyway to ensure that all asynchronous operations in
onReceiveMetadata
is awaited for before the call is finished?I thought that the
next
callback that is used would ensure that GRPC call doesn't finish until all asynchronous operations have finished, but that's not the case.Alternatively if I can ensure that all interceptor asynchronous operations are finished before #1340
client.close()
is finished, that would also be useful for my problem.Example:
The text was updated successfully, but these errors were encountered: