-
Notifications
You must be signed in to change notification settings - Fork 169
Queue task_done/join enhancement #108
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
Comments
Related but seperate, my original implementation idea was semaphore like, essentially acquiring (incrementing) on each put, and then releasing on task_done. I had an issue with it, essentially, my program was exiting on event.wait().... Is it just me or have you seen this? I would expect this to hang. On Python3 it does, but on micropython it exits without message on both unix and esp32 ports.
I see the same thing if I add wait before event is set, like this, but the wait could be in the waiter as well.
|
Re I agree the first example should hang and can confirm that it doesn't. I'm not clear about the second example - what is the |
I'll put together a PR with associated test, no problem. For the second example, what I did not mention and should have is that is reproducable using the Event example from the documentation as a starting point. A little more 'in application' I guess. The initial example is probably better for raisining an issue. |
Hello @peterhinch,
In my project, I've found itility in the task_done/join feature in Queue:
https://docs.python.org/3/library/asyncio-queue.html
I have something like:
If there's interest, happy to create a PR for this.
The text was updated successfully, but these errors were encountered: