-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: hard to test cooperative execution
This is because it relies on a scheduler outside of our domain (JavaScript) Solution: allow to run a callback after the queue is exhausted This changes `single_threaded::run_cooperatively` type signature a bit, adding an extra parameter. The testing is still not perfect as we can't really ensure the callback was called, but if it *was*, then we can run the assertions. This can be alternatively done by something like `join_all` for all futures representing tasks scheduled and spawning another task to do something after they've been joined, but it seems at the time that adding this callback has lower impact / easier ergonomics (but, of course, it's less "pure" if you may)
- Loading branch information
Showing
2 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters