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

Adding a timeout method to not block indefinitely next event #386

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

haixuanTao
Copy link
Collaborator

This PR adds a recv_timeout method to not block indefinitely on next event.

This is implemented using future select between a delay and the next event.

In case of time out the next event is going to be an error of type timeout.

Copy link
Collaborator

@phil-opp phil-opp 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 to me overall!

apis/rust/node/src/event_stream/mod.rs Show resolved Hide resolved
Copy link
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thanks!

@phil-opp phil-opp merged commit 631dcff into main Dec 8, 2023
17 checks passed
@phil-opp phil-opp deleted the timeout-receiver branch December 8, 2023 15:34
@haixuanTao haixuanTao mentioned this pull request Jan 9, 2024
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.

2 participants