You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the TimedCancellable and Cancellable patterns we have a structured way of handling cancellation of long running async tasks. But we've been a bit lax applying it to the code base. Only updating code when doing refactoring or conversions. It's become evident that further review and work needs to be done to apply it to the whole code base.
So what does it need to be applied to. Well the following could take a long time to compelete.
A promise doing something complex or waiting for something complex to complete.
An AsyncGenerator returning a potentially unbounded stream of information.
A normal generator doing the same
Iterators generally but for the most part these will be bounded by memory limits so we will run into memory problems before time problems generally.
So based on this criteria we need to look through the code and apply cancelability to promises and generators. Futher more the following domains that do general background processing that needs to stop quickly need to be reviewed.
Nodes domain.
Tasks domain.
Discovery domain.
notifications domain.
Each of these maintain some degree of background state that can take time to clean up when stopping. In the worst case they will block stopping altogether if proper cancellation isn't supported.
Specification
With the
TimedCancellable
andCancellable
patterns we have a structured way of handling cancellation of long running async tasks. But we've been a bit lax applying it to the code base. Only updating code when doing refactoring or conversions. It's become evident that further review and work needs to be done to apply it to the whole code base.So what does it need to be applied to. Well the following could take a long time to compelete.
AsyncGenerator
returning a potentially unbounded stream of information.So based on this criteria we need to look through the code and apply cancelability to promises and generators. Futher more the following domains that do general background processing that needs to stop quickly need to be reviewed.
Each of these maintain some degree of background state that can take time to clean up when stopping. In the worst case they will block stopping altogether if proper cancellation isn't supported.
Additional context
timedCancellable
across the board to control how long side-effects are allowed to complete #450Tasks
The text was updated successfully, but these errors were encountered: