dabeaz / curio

Good Curio!
Other
4.02k stars 241 forks source link

Adding new tasks to a `curio.wait` #184

Closed Fuyukai closed 7 years ago

Fuyukai commented 7 years ago

I have a set of tasks that are tracked(?) by a curio.wait object to check if they are finished. If the tasks crash, or if I need to add a new task to this list, I have no way of rebooting them and re-inserting them into the wait without cancelling all tasks and re-creating the wait, or using the internal private API.

It'd be nice if there was a way to insert a new task into a waiter without having to re-create it.

dabeaz commented 7 years ago

Interesting What would you propose as an API for this? Is it enough to give the waiter object an add_task() method of some kind?

Fuyukai commented 7 years ago

Yes, that would be good.

dabeaz commented 7 years ago

Done. Use await w.add_task(task) to add a task to existing "wait" object.