Closed ggicci closed 1 year ago
Hi, thanks for the changes. Can you please give some more motivation in your description around why you made this change, the shortcomings of the current API and why this is better. It isn't really that clear to me, which also makes it hard to see if this justifies a backwards incompatible change.
@keegancsmith Sure. I'm still working on this. The original implementation is okay but I hope my changes can make the API more clear and concise. I will give more explanations here and discuss the advantages when I finished this. Thanks :)
Sorry I'm not able to finish this in the foreseeable future. I will close it for now.
jsonrpc2.Handler
interface will be changed fromto
context
more easily from handlers to handlers, thecontext
will be attached toRequest
. And the following new methods will be added toRequest
:Chain(middleware ...Middleware)
will be added for writing middlewares.I hope this could help.