Skip to content

Remove risk of getting "coroutine 'Queue.get' was never awaited" warning. #687

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

knutroy
Copy link

@knutroy knutroy commented Apr 22, 2025

This could happen when the coroutine object returned from asyncio.Queue.get() was handed over to a newly created task which was then immediately cancelled so that the coroutine object was never awaited.

Instead, let the newly created task itself make the call to asyncio.Queue.get() before immediately awaiting it.

Resolves #646.

Signed-off-by: Knut Aksel Røysland knutroy@ifi.uio.no

…ing.

This could happen when the coroutine object returned from
asyncio.Queue.get() was handed over to a newly created task which was then
immediately cancelled so that the coroutine object was never awaited.

Instead, let the newly created task itself make the call to
asyncio.Queue.get() before immediately awaiting it.

Resolves nats-io#646.

Signed-off-by: Knut Aksel Røysland <knutroy@ifi.uio.no>
@knutroy knutroy marked this pull request as ready for review April 22, 2025 21:39
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.

Hitting RuntimeWarning: coroutine 'Queue.get' was never awaited
1 participant