You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apps often employ some form of inversion of control, and network layer APIs often see the biggest use cases for this pattern, where apps want to register things like "whenever an HTTP request goes out, give me a hook into it (to mutate or outright replace it)" The same goes for inbound responses.
I suggest we add support for request & response interceptors, where callers can register themselves to form an interceptor chain.
@nex3 if you're open to the idea, I'll write up a more detailed design proposal.
The text was updated successfully, but these errors were encountered:
This is actually a core feature of the package! It was designed to be possible to create a Client subclass that wraps another Client and adds behavior like you're describing—see the http_throttle package for an example.
The API is currently not super nice, but @donny-dont is working on a major refactor that's dramatically improving it. You can see the progress on the master branch.
Apps often employ some form of inversion of control, and network layer APIs often see the biggest use cases for this pattern, where apps want to register things like "whenever an HTTP request goes out, give me a hook into it (to mutate or outright replace it)" The same goes for inbound responses.
I suggest we add support for request & response interceptors, where callers can register themselves to form an interceptor chain.
@nex3 if you're open to the idea, I'll write up a more detailed design proposal.
The text was updated successfully, but these errors were encountered: