zenrpc
zenrpc copied to clipboard
Middileware func before request
Please provide example Middileware func that runs before request is precessed but after rpc acquires method and params for request.
Needed for uuid generation for specific request.
Thank you for your feedback. We are going to implement Funcware. It's like a middleware, but runs in another part of flow: Middleware -> Funcware -> Func -> Funcware -> Middleware
.
Funcware:
// call before => method, namespace, args
resp.Set(s.Method(args.S))
// call after => result, err
So, you'll be able to access (and modify) result and error and access to args as struct before. Is it ok for you?
@sergeyfast Thanks for quick response, yes this should be sufficient.
Any timeframe on this feature?