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
In order to support stuff like #21114, we need the ability to cancel tasks in a more granular way, at the level of 'per tasksource'.
Currently 'cancelling' tasks is basically dependent on the ignore_further_async_events field on Window, which is the basis for the TaskCanceller returned via task_canceller, which is accessed via the queue method of the TaskSource trait(via the globalscope passed to that function).
One idea I can come up with is adding a new method to TaskSource, something like fn choose_canceller<T>(&self, global: &GlobalScope) -> TaskCanceller, and then change queue to read something like the below:
let canceller = self.choose_canceller(&global);
self.queue_with_canceller(task, canceller);
Then each task source will need to implement choose_canceller, calling the appropriate method of GlobalScope, which would forward the call to the window, and the window would require a flag similar to ignore_further_async_events for each task source...
Activity
jdm commentedon Jul 4, 2018
That implementation makes sense to me!
Auto merge of #21126 - gterzian:tasksource_specific_cancelation, r=jdm