Open Ddystopia opened 3 months ago
On a similar note. I found it would be handy to have access to pausing, resuming, restarting and cancelling tasks by getting a handle.
I have a project when I need to restart about 12 tasks and if I could cancel and recreate the tasks it would be much neater than having to have the same large blocks of code 12 times in each task.
Hello,
In my use case I would like to have something like
embassy_executor::Spawner::replace_spawn
, that will always succeed. If it cannot spawn a new task, it would cancel some already existing one.I am sending messages to a network, and it would be easier to do
replace_spawn
then writing that logic inside task itself.