-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpc/v2 middleware #50
Comments
+💯 for a system of middleware. I ran into a similar situation and came looking for a solution. It'd be incredibly useful for implementing standard logging as well as other application conventions. |
We'd be more than open to (in this order!):
a) a document covering the design of a middleware API
b) a PR adding this to the library
I don't believe myself or @kisielk otherwise have time to contribute, but
we're both more than happy to assist with design & code review.
…On Sun, May 14, 2017 at 6:19 PM Tejas Manohar ***@***.***> wrote:
+💯 for a system of middleware. I ran into a similar situation and came
looking for a solution. It'd be incredibly useful for implementing standard
logging as well as other application conventions.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#50 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABIcNtFEy70EZG_---197Z5BTYcSp_5ks5r56gegaJpZM4NNbhg>
.
|
Sounds good! ... But, now that I think of it, is there anything that can't be done with Would you all be open to this? I can PR to show what I mean. It shouldn't have to be a breaking change... we can just add nill-able req/res fields to |
At dotmesh.com we use gorilla/rpc and this was a feature I required to send out metrics to via prometheus instrumentation. I've added RegisterBeforeFunc, RegisterAfterFunc, and RegisterInterceptFunc into v2 on a fork here. Will submit a PR shortly. |
I was just looking for this capability and as I found the feature request might have been resolved since the named hooks are already merged. From code review I'd say this issue can be closed. |
You can write a Codec wrapper which acts like a middleware. |
When I writing rpc server based on rpc/v2, I need to use middleware for logging or, for example, for writing some metrics. I can use handlerFunc middlewares in style
But it is not comfortably. I would like to know rpc method name and parsed request.
Just in rpc server (not v2) I found RegisterBeforeFunc that looking helpful, but in v2 it is not exist.
Please, suggest me how can I solve that problem?
The text was updated successfully, but these errors were encountered: