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

Better workflow #34

Closed
wants to merge 2 commits into from
Closed

Better workflow #34

wants to merge 2 commits into from

Commits on May 5, 2020

  1. Configuration menu
    Copy the full SHA
    80532ed View commit details
    Browse the repository at this point in the history

Commits on May 6, 2020

  1. Refactor wakers to use piper::Event to notify pending streams an item…

    … is ready
    
    Stream Trait is similar to the Future Trait in that it requires internal logic
    to let the executor know when the stream's state changes from Poll::Pending to
    Poll::Ready.
    
    In the original implementation mpsc channel and AtomicWakers were used. The
    AtomicWaker was used to contain the future's context and wake the task, while
    the channel was used to send AtomicWakers from Subscribers to the Publisher.
    After publishing a new item the Publisher collected all the AtomicWakers and
    called the wake method.
    
    This refactor replaces that logic with piper::Event which is awaited in the
    Stream::poll_next method until the Publisher signals that event by calling the
    Event::notify method.
    
    An additional close method was added to channel::Sender which explicitly let's
    all Receivers and Subscribers know that the Sender or Publisher has stopped
    publishing items.
    filipdulic committed May 6, 2020
    Configuration menu
    Copy the full SHA
    a6884aa View commit details
    Browse the repository at this point in the history