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

Support for recv_timeout #136

Open
jesdazrez opened this issue Aug 14, 2024 · 2 comments
Open

Support for recv_timeout #136

jesdazrez opened this issue Aug 14, 2024 · 2 comments

Comments

@jesdazrez
Copy link

It would be nice if a RingReceiver supported a receive with a timeout operation. Are there plans to add one?
I'd be up to help with the implementation if there's some guidance available :).

@brunocodutra
Copy link
Owner

Hi, thank you for the interest in the library! The challenge with adding timed block operation is that this needs an async executor that is quite a bit more complicated than the futures::executor::block_on we currently use under the hood, and I don't think it really makes sense to either build a dependency on some full fledged async executor, or to build our build.

What problem are you actually trying to solve? If you are already using something like Tokio you can wait on a message with a timeout very easily, see for example https://docs.rs/tokio/latest/tokio/time/fn.timeout.html. I'm sure other async frameworks have something equivalent as well.

@jesdazrez
Copy link
Author

Thanks for the quick replay!
I see, makes perfect sense to keep the lib executor-agnostic 👍.

I'm using tokio but not in the part of the project where I'm using the RingReceiver. However I think I can refactor some of it to be able to use tokio's features there.

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

No branches or pull requests

2 participants