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

support RW ready in waiting functions #120

Merged
merged 6 commits into from
Nov 16, 2021
Merged

Commits on Nov 16, 2021

  1. Add unit tests for wait*() functions

    We check that when a generator waits for a Wait value, it gets a Ready
    value that matches. The socket we wait on is read- and write-ready.
    
    These tests hang on non-Linux platform in CI, perhaps because some
    socket operations (e.g. fileno()) are not portable, so we only run them
    on Linux.
    
    As is, wait_epoll() fails this test because it assumes that readiness is
    either read or write, not both.
    dlax authored and dvarrazzo committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    f3c3207 View commit details
    Browse the repository at this point in the history
  2. Fix wait_epoll() when the fd is read- and write-ready

    We follow the implementation of EpollSelector.select(). The
    test_wait_ready() introduced previously added now passes for
    wait_epoll().
    dlax authored and dvarrazzo committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    0380464 View commit details
    Browse the repository at this point in the history
  3. Add an assertion in wait_selector() / wait_epoll()

    Making sure the ready event matches what we're waiting on.
    dlax authored and dvarrazzo committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    eb38222 View commit details
    Browse the repository at this point in the history
  4. Handle RW-ready in wait(,_conn)_async()

    dlax authored and dvarrazzo committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    84a438e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b33cdae View commit details
    Browse the repository at this point in the history
  6. Possibly send a Ready.RW value to generators waiting on RW

    In some generators, we might be interested in receiving both read-ready
    and write-ready event at the same time.
    
    Per previous commits, all wait*() functions support this.
    
    This is covered by test_wait_ready(), which now maps Wait.RW to
    Ready.RW.
    dlax authored and dvarrazzo committed Nov 16, 2021
    Configuration menu
    Copy the full SHA
    4cf0450 View commit details
    Browse the repository at this point in the history