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

Conversation

filipdulic
Copy link
Owner

No description provided.

… 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 filipdulic closed this May 6, 2020
@filipdulic filipdulic deleted the better-workflow branch May 6, 2020 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant