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

feat: adds Web3SubscriptionsManager.get_subscription_data_nowait() #95

Merged
merged 10 commits into from
Jul 17, 2024

Conversation

mikeshultz
Copy link
Member

@mikeshultz mikeshultz commented Jul 12, 2024

What I did

Adds Web3SubscriptionsManager.get_subscription_data_nowait() to add the ability to poll without a hanging iterator.

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

@mikeshultz mikeshultz added the enhancement New feature or request label Jul 12, 2024
@mikeshultz mikeshultz self-assigned this Jul 12, 2024
@mikeshultz mikeshultz changed the title feat: adds Web3SubscriptionsManager.pop_subscription_data() feat: adds Web3SubscriptionsManager.get_subscription_data_nowait() Jul 13, 2024
@mikeshultz mikeshultz marked this pull request as ready for review July 13, 2024 01:41
if not self.connection:
raise ConnectionError("Connection not opened")

message = await asyncio.wait_for(self.connection.recv(), timeout)
Copy link
Member

@fubuloubu fubuloubu Jul 16, 2024

Choose a reason for hiding this comment

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

Is this the location where node websockets end up raising after getting randomly dropped?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like it, according to the trace on #84

Copy link
Member

Choose a reason for hiding this comment

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

Nice, we might want to come back later and handle this timeout by reconnecting

@mikeshultz mikeshultz merged commit 34a12e0 into main Jul 17, 2024
26 checks passed
@mikeshultz mikeshultz deleted the feat/subscription-pop branch July 17, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants