Skip to content

Support aborting async tasks via AbortSignal #803

Description

@ShaMan123

Description 📝

I want to be able to abort async work that is no longer needed (superseded or aborted altogether):

  • a model loading
  • an outliner being repeatedly updated
  • an ifc coversion that has been dropped

Related: ThatOpen/engine_fragment#173 (though it doesn't actually provide an AbortSignal functionality).

Suggested solution 💡

Every async method should accept an { signal: AbortSignal } providing the consumer full control over aborting it.
IMO it should a design rule enforced by lint.
It is the only way to bridge the threaded/async nature of the packages.
I have spent a lot of time and effort trying to workaround this with queues etc. - it is awkward and error prone.

Alternative ⛕

NONE.
Currently each task is drained and the consumer must reconcile the results when it settles.
This is extremely suboptimal, e.g. #802

Additional context ☝️

ThatOpen/engine_fragment#305

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureSomething new that we could do

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions