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 ✅
Description 📝
I want to be able to abort async work that is no longer needed (superseded or aborted altogether):
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 ✅