Suppose I have a parent task that forks another task inside its executor at some point.
Is there a suggested way to bind the forked task to the parent's execution, so that when the parent is resolved, rejected or canceled, that task is canceled?
The use case for this is this:
The parent task acquires some external lock and runs the substask while it owns the lock. When canceled, parent task releases the lock. When the lock is forcibly released from outside, or on connectivity problems, parent task is rejected. I'd like the subtask to be canceled automatically in these cases, similarly to how it happens redux-saga.
Suppose I have a parent task that forks another task inside its executor at some point.
Is there a suggested way to bind the forked task to the parent's execution, so that when the parent is resolved, rejected or canceled, that task is canceled?
The use case for this is this:
The parent task acquires some external lock and runs the substask while it owns the lock. When canceled, parent task releases the lock. When the lock is forcibly released from outside, or on connectivity problems, parent task is rejected. I'd like the subtask to be canceled automatically in these cases, similarly to how it happens
redux-saga.