Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: hard to test cooperative execution #14

Closed
wants to merge 1 commit into from

Commits on Feb 12, 2021

  1. 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)
    yrashk committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    089ed60 View commit details
    Browse the repository at this point in the history