zenrpc icon indicating copy to clipboard operation
zenrpc copied to clipboard

Middileware func before request

Open s3rj1k opened this issue 6 years ago • 2 comments

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.

s3rj1k avatar Nov 29 '17 13:11 s3rj1k

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 avatar Nov 29 '17 16:11 sergeyfast

@sergeyfast Thanks for quick response, yes this should be sufficient.

Any timeframe on this feature?

s3rj1k avatar Nov 29 '17 22:11 s3rj1k