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

Custom timeout for requests #687

Merged
merged 11 commits into from
May 7, 2024
Merged

Custom timeout for requests #687

merged 11 commits into from
May 7, 2024

Conversation

ckeshava
Copy link
Collaborator

High Level Overview of Change

Certain requests could take more time to return a response, than the default 10 seconds duration. This change allows users to specify a custom timeout parameter to all requests.
Additionally, this PR sets up uniform interfaces for all Client._request_impl overridden functions.

Context of Change

In the present code, all requests are given 10 seconds duration to return a response. Any longer latency results in a timeout. This is inconvenient for certain commands that are known to take up more time, for instance, admin-only commands like the ledger command.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Did you update CHANGELOG.md?

  • Yes
  • No, this change does not impact library users

Test Plan

This is an existing integration test that invokes the ledger command at tests/integration/reqs/test_ledger.py. Which other command might take up more time?

…tions

TODO: set up integration tests to ensure that high latency commands (like ledger) do not timeout within the default 10 seconds
Copy link
Collaborator

@mvadari mvadari left a comment

Choose a reason for hiding this comment

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

It doesn't look like this PR actually modifies the external-facing methods.

xrpl/asyncio/clients/client.py Outdated Show resolved Hide resolved
xrpl/asyncio/clients/websocket_base.py Outdated Show resolved Hide resolved
@ckeshava ckeshava requested a review from mvadari March 20, 2024 00:18
@ledhed2222
Copy link
Collaborator

i just happened to see this. it looks good to me! great idea :)

@ckeshava
Copy link
Collaborator Author

ckeshava commented May 7, 2024

thank you for the reviews. If there are no more objections, I'd like to merge this PR

@ckeshava ckeshava merged commit 260d7dc into main May 7, 2024
21 checks passed
@ckeshava ckeshava deleted the requestImplInterface branch May 7, 2024 18:48
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.

5 participants