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

Does consumer.next is cancellation-safe method? #395

Open
henry42 opened this issue Jan 29, 2024 · 2 comments
Open

Does consumer.next is cancellation-safe method? #395

henry42 opened this issue Jan 29, 2024 · 2 comments

Comments

@henry42
Copy link

henry42 commented Jan 29, 2024

I am trying to use
select! { delivery = consumer.next(), other future => ... }
to fetch new messages. I have tried it, and it worked like a charm.
However, I want to make sure that it is a cancellation-safe method where I won't lose any messages. Thank you.

@Keruspe
Copy link
Collaborator

Keruspe commented Jul 11, 2024

Any reason why you're not storing the future returned by consumer.next()?
This way it will be cancellation-safe for sure

@henry42
Copy link
Author

henry42 commented Jul 11, 2024

Any reason why you're not storing the future returned by consumer.next()? This way it will be cancellation-safe for sure

Thanks for the reply. If the consumer encounters other events (such as timeout or sigterm), it may exit.

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