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

Allow for configuring the request information cache size on wsV2 #3226

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

fselmo
Copy link
Collaborator

@fselmo fselmo commented Feb 6, 2024

What was wrong?

Along with a PR to v7, once #3225 is merged, will close #3219

How was it fixed?

  • Allow for configuring the request_information_cache size so users making a high number of requests do not run into the request information being lost for responses.
  • Add a test that uses the configuration to set the size to 1 and checks a warning is issued when full.

Todo:

Cute Animal Picture

@fselmo fselmo marked this pull request as ready for review February 6, 2024 22:27
@fselmo fselmo requested review from reedsa and kclowes February 6, 2024 22:27
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

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

looks good! I left a couple comments, but feel free to merge once you think it's ready!

@@ -34,11 +34,13 @@ class PersistentConnectionProvider(AsyncJSONBaseProvider, ABC):
def __init__(
self,
request_timeout: float = DEFAULT_PERSISTENT_CONNECTION_TIMEOUT,
request_information_cache_size: int = 500,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It probably doesn't matter much, but the order of the kwargs may be confusing if anyone was using the subscription_response_queue_size. Consider adding it after subscription_response_queue_size?

docs/providers.rst Show resolved Hide resolved
@fselmo fselmo merged commit 47a4e56 into ethereum:v6 Feb 7, 2024
99 checks passed
fselmo added a commit to fselmo/web3.py that referenced this pull request Feb 7, 2024
@fselmo fselmo deleted the v6-configure-req-info-cache-size branch April 3, 2024 20:49
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.

3 participants