Skip to content
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

Add WrapExecutor #477

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add WrapExecutor #477

wants to merge 3 commits into from

Conversation

lavoiesl
Copy link
Contributor

@lavoiesl lavoiesl commented Oct 14, 2021

Add the ability to wrap the request executor, granting full access to the request, response, and error.
Runs on every request attempt, before any request hook and after any response or error hook.

Can be useful to introduce throttling or add hooks that always fire, regardless of success or error.
Having access to the request even in case of errors means also having access to the request's context, which can be immensely helpful for proper error logging/reporting.

This PR is dependant on #478, to avoid re-wrapping noRetryError

@jeevatkm
Copy link
Member

@lavoiesl Thanks for your suggestion. With this improvement, I think we can restructure within Resty. I will consider this for Resty v3

@jeevatkm jeevatkm added the v3 For resty v3 label Oct 24, 2021
@jeevatkm jeevatkm added this to the v3.0.0 Milestone milestone Oct 24, 2021
- Expose an `Unwrap` method to leverage go's standard unwrapping
- Let the error escape, such that hooks and end-users can access the
  `Temporary` information.
- Do not wrap if the error already exposes `Temporary`, to honour it.
@lavoiesl
Copy link
Contributor Author

@jeevatkm Is there still a plan to release a v3? We ended up having to maintain a fork of resty because this hook proved essential to throttling, error handling, and metrics gathering.

@jeevatkm
Copy link
Member

jeevatkm commented Mar 5, 2023

@lavoiesl I will aim this concept for v3. I know, I got delayed so much, I will make up for it. Thanks for your patience.

@jeevatkm jeevatkm added v3-consideration and removed v3 For resty v3 labels Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants