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

Use broadcast::Receiver::recv instead of next #2933

Merged
merged 4 commits into from
Oct 30, 2021

Conversation

jvff
Copy link
Contributor

@jvff jvff commented Oct 21, 2021

Motivation

This is part of the update to use Tokio version 1 (#2200), and must be merged together with the other PRs.

On newer versions of Tokio the broadcast::Receiver doesn't implement Stream, so the StreamExt::next method used in tower-batch is no longer available.

Solution

Instead of wrapping the broadcast::Receiver in a tokio_stream::wrappers::BroadcastStream like in #2922, in this case a simpler solution was used, simply replacing the usage of StreamExt::next() with broadcast::Receiver::recv().

Review

Anyone from the team can review this, but it shouldn't be merged yet.

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

@jvff jvff requested a review from a team October 21, 2021 21:23
@jvff jvff self-assigned this Oct 21, 2021
@teor2345 teor2345 marked this pull request as ready for review October 28, 2021 01:00
teor2345
teor2345 previously approved these changes Oct 28, 2021
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

broadcast::Receiver::recv exists in tokio 0.3.7:
https://docs.rs/tokio/0.3.7/tokio/sync/broadcast/struct.Receiver.html#method.recv

So we can merge this low-risk PR before the beta release if you want.

On newer versions of Tokio the `Receiver` doesn't implement `Stream`.
Copy link
Contributor

@mpguerra mpguerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on behalf of @teor2345 as per #2933 (review)

@mpguerra mpguerra mentioned this pull request Oct 29, 2021
10 tasks
@mpguerra mpguerra marked this pull request as draft October 29, 2021 13:58
@mpguerra mpguerra marked this pull request as ready for review October 29, 2021 13:59
@conradoplg conradoplg marked this pull request as draft October 29, 2021 17:12
@conradoplg
Copy link
Collaborator

I just moved this to draft since from the description it seems it can't be merged by itself. @jvff is this correct?

@conradoplg
Copy link
Collaborator

Ah sorry, I just saw @teor2345 's comment 😅

@conradoplg conradoplg marked this pull request as ready for review October 29, 2021 17:14
@jvff jvff merged commit 6905c79 into ZcashFoundation:main Oct 30, 2021
@jvff jvff deleted the use-recv-instead-of-next branch October 30, 2021 00:28
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.

4 participants