Skip to content

[labs/task] Provide an AbortSignal to task functions and abort pending signals on new task runs #3995

@justinfagnani

Description

@justinfagnani

Should this be an RFC?

  • This is not a substantial change

Which package is this a feature request for?

Task (@lit-labs/task)

Description

In many cases you'l want to abort pending task runs when a new run is started. For example, you may want to abort a fetch call when a new one is made.

We can enable this by creating an AbortController per task run, passing the signal to the task function, and aborting any signal from a previous pending run when a new run is started.

Alternatives and Workarounds

Userland code could do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions