Skip to content

Tag: events

Wait for timeout or event being set for asyncio.Event

I have a class with a method that looks like this: The idea is that several of these are run in their own thread and at some point one thread does stop_event.set(), which naturally stops all others. I want to switch to asyncio for this, because the tasks in run are mostly sleeping and doing IO. Thus, I got to…