Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTaskSource-specific TaskCanceller #21119
Closed
Comments
|
That implementation makes sense to me! |
bors-servo
added a commit
that referenced
this issue
Jul 10, 2018
Introduce "per task source" cancellation <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #21119 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21126) <!-- Reviewable:end -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 theTaskCancellerreturned 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 likefn choose_canceller<T>(&self, global: &GlobalScope) -> TaskCanceller, and then changequeueto read something like the below:Then each task source will need to implement
choose_canceller, calling the appropriate method ofGlobalScope, 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...Any better ideas?