Skip to content

Binding forked subtask to a parent task #2

Description

@aikoven

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions