Repository navigation
Introduce "per task source" cancellation - #21126
Conversation
|
Heads up! This PR modifies the following files:
|
edd4f18 to
ebaf7cd
Compare
c277174 to
e33b2ff
Compare
|
This one is ready for review, although I'm wondering about the right testing strategy for this one... |
bd8c344 to
48adf6a
Compare
|
For clarity this isn't suppose to 'change' anything about the behavior of the system, it only lays the groundwork for later changes, for example in #21114, which will require using a dedicated task source for So perhaps a good way to test is 'making sure everything still works as before', and then it is the follow up work that will include tests specifically asserting that certain tasks are cancelled while others still run? |
9f20d1e to
8799aa0
Compare
| // Retuns a vec of variants of TaskSourceName. | ||
| // Note: When adding a variant, update the vec. | ||
| pub fn all() -> Vec<TaskSourceName> { | ||
| vec![ |
There was a problem hiding this comment.
We might as well make use of https://crates.io/crates/enum-iterator rather than keep track of this manually.
| where | ||
| T: TaskOnce + 'static; | ||
|
|
||
| fn choose_canceller(&self, global: &GlobalScope) -> TaskCanceller; |
There was a problem hiding this comment.
It might make sense to use an associated constant instead, rather than having similar implementations for each task source.
| context: context, | ||
| task_source: window.networking_task_source(), | ||
| canceller: Some(window.task_canceller()), | ||
| canceller: Some(window.task_canceller(TaskSourceName::Networking)), |
There was a problem hiding this comment.
As a followup, we should do something to avoid all of the duplication of calling foo_task_source and then getting a canceller where it's easy to end up with one for a different source. Possibly the foo_task_source APIs could return both a source and a canceller at the same time.
044387f to
731fdee
Compare
|
@jdm Thanks for the pointers, comments have been addressed... |
731fdee to
671627e
Compare
|
@bors-servo r+ |
|
📌 Commit 671627e has been approved by |
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 -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
…tsource, r=jdm Use remote-event task source in EventSource <!-- Please describe your changes on the following line: --> Follow up on #21126, this again 'changes nothing', but will be useful for #21111 in the context of #21114 Trying to break up work into smaller PR's ;) --- <!-- 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 #21112 (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/21170) <!-- Reviewable:end -->
…tsource, r=jdm Use remote-event task source in EventSource <!-- Please describe your changes on the following line: --> Follow up on #21126, this again 'changes nothing', but will be useful for #21114 in the context of #21111. Trying to break up work into smaller PR's ;) --- <!-- 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 #21112 (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/21170) <!-- Reviewable:end -->
…tsource, r=jdm Use remote-event task source in EventSource <!-- Please describe your changes on the following line: --> Follow up on #21126, this again 'changes nothing', but will be useful for #21114 in the context of #21111. Trying to break up work into smaller PR's ;) --- <!-- 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 #21112 (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/21170) <!-- Reviewable:end -->
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is