Run a simple grpc-server with a unary service (it doesn't matter what, just keep it simple). Hit it with ghz -d 6s ... and don't specify the --duration-stop option, so the client closes connections ...
gRPC Server Interceptor でメソッド呼び出し後に処理をする 以前の記事 でも触れましたが、gRPC Interceptor は処理の前後に処理を挟み込む機能です。前回はメソッドの呼び出し前に処理をする例でしたが、今回はメソッドの呼び出し後に処理を実施します。下のコードの (1) の箇所になります。
We are hosting a grpc service in a generic way except: There are cases where we're running in the context of a user request, and add some work to a queue. A background thread will process the queue ...