gorilla / rpc

Package gorilla/rpc is a golang foundation for RPC over HTTP services.
https://gorilla.github.io
BSD 3-Clause "New" or "Revised" License
595 stars 179 forks source link

allow multiple hook functions #71

Closed joelmarty closed 7 months ago

joelmarty commented 5 years ago

Allows to register more than one interceptFunc, beforeFunc and afterFunc.

The use-case is that your hook functions may come from libraries, or you don't want to mix responsibilities so each function takes care of a specific thing.

jaitaiwan commented 9 months ago

Thanks for the contribution @joelmarty. I'm inclined to think that multiple functions should be the responsibility of the application that's using the library. If I was using a library that integrated this one, I would make a reference to the existing hook functions, replace the hook functions with a function of my own that allowed for multiple sub-calls and use that.

TL;DR: I don't think this is a feature that is necessary for the library to implement.

Thoughts @AlexVulaj @apoorvajagtap ?

AlexVulaj commented 8 months ago

Thanks for the contribution @joelmarty ! I'm going to agree with my colleague @jaitaiwan on this one - I think that multiple hook functions should be the responsiblity of the application. I'll let him make the final call but my motion is to pass on this PR at this time.

joelmarty commented 7 months ago

I don't even work at the company I wrote this PR for anymore 🤷🏻