Nathaniel:
After calling server_shutdown which stops a server from accepting new RPCs and connections, wanting to know how many RPCs the server is still processing and wanting to be alerted when all RPCs are completed are reasonable requests for code using the GRPC C core to want to make.
If we decide not to do this, they could count how many GRPC_SERVER_RPC_NEW events they've accepted against how many GRPC_FINISHED events they've processed.
Craig:
The count of inflight requests is something I'd rather not expose: anything relying on it is inherently racy.
I propose changing grpc_shutdown to:
/* Begin shutting down a server.
After completion of this call, no new calls or connections will be admitted.
Existing calls will be allowed to complete.
When all calls have completed, emit a GRPC_SHUTDOWN_COMPLETE event with tag 'tag'. */
void grpc_server_shutdown(grpc_server *server, void *tag);