Use `broadcast::Receiver::recv` instead of `next` (#2933)

On newer versions of Tokio the `Receiver` doesn't implement `Stream`.
This commit is contained in:
Janito Vaqueiro Ferreira Filho 2021-10-29 21:28:54 -03:00 committed by GitHub
parent 0db35fbee0
commit 6905c79fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -6,7 +6,6 @@ use std::{
use futures::future::TryFutureExt;
use pin_project::pin_project;
use tokio::{
stream::StreamExt,
sync::mpsc,
time::{sleep, Sleep},
};
@ -127,7 +126,7 @@ where
let mut pending_items = 0usize;
loop {
match timer.as_mut() {
None => match self.rx.next().await {
None => match self.rx.recv().await {
// The first message in a new batch.
Some(msg) => {
let span = msg.span;