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

Interceptors #141

Merged
merged 5 commits into from
Mar 12, 2024
Merged

Interceptors #141

merged 5 commits into from
Mar 12, 2024

Conversation

mr-linch
Copy link
Owner

No description provided.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Type: Enhancement

PR Summary: This pull request introduces the concept of interceptors to the client, allowing for pre-processing and post-processing of requests. It includes the implementation of two specific interceptors: one for retrying requests that fail due to flood errors, and another for retrying requests that fail due to internal server errors. Additionally, the PR makes modifications to the client structure to accommodate interceptors and updates example usage to demonstrate how interceptors can be added to a client.

Decision: Comment

📝 Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Consider adding more detailed documentation for each interceptor, explaining the scenarios in which they would be useful. This can help users understand when and why to use these interceptors.
  • It might be beneficial to include examples or use cases demonstrating the interceptors' impact on request handling in real-world scenarios. This could further clarify their utility.
  • Evaluate the possibility of introducing a mechanism for easily combining multiple interceptors, ensuring they can be composed in a flexible manner without requiring significant boilerplate code.
  • Review the interceptor implementation for potential optimizations, particularly in how interceptors are chained and invoked. This could enhance performance, especially for clients making a high volume of requests.
  • Ensure thorough testing of the interceptors, particularly in edge cases such as rapid retries or high concurrency, to guarantee their reliability and effectiveness in various conditions.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.61%. Comparing base (ac8b430) to head (ba4e69b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
+ Coverage   94.23%   94.61%   +0.38%     
==========================================
  Files          20       21       +1     
  Lines        2219     2320     +101     
==========================================
+ Hits         2091     2195     +104     
+ Misses         91       85       -6     
- Partials       37       40       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mr-linch mr-linch merged commit 5cf133d into main Mar 12, 2024
5 checks passed
@mr-linch mr-linch deleted the interceptors branch March 12, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant