Call/BatchCall RPC Hook
Client composite MiddlewarableMiddle for support setting middleware by HookCallContext
for hooking provider.CallContext
method which is the core of all single RPC-related methods. And HookBatchCallContext
to set middleware for hooking BatchCallContext
.
For example, we can custom a logger middleware to log for rpc requests.
and the callContextConsoleMiddleware
implementation is like
Also, you could
customize middleware
use multiple middlewares
Notice that the middleware chain execution order is like onion, for example, use middleware A first and then middleware B
the middleware execution order is
Last updated