`grpc.Client.close()` should have a callback when all calls complete
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 716
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 10
Description
### Is your feature request related to a problem? Please describe.
I'd like to call `close` on all grpc clients when the app is shutting down, and wait for the in-flight requests to complete.
### Describe the solution you'd like
As per #1211:
>The `close` method prevents new calls from being started and frees up resources once all active calls have finished
I'd like to get a callback "once all active calls have finished" so I know it's safe to shutdown the server
(ideally it'd return a `Promise`, but since the API is using callbacks, this should as well for consistency)
### Describe alternatives you've considered
Right now we call `close` then immediately `process.exit(0)`. It generally works fine, but there might be inflight requests we then ignore.
### Additional context
Contributor guide
Assessment
This issue has not been assessed yet.