mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Use waker API instead of recursing
This commit is contained in:
parent
808a0cf4fb
commit
2b7eea2679
1 changed files with 4 additions and 2 deletions
|
@ -406,8 +406,10 @@ impl<B: Requester> Stream for PollingStream<'_, B> {
|
||||||
.send();
|
.send();
|
||||||
this.in_flight.set(Some(req));
|
this.in_flight.set(Some(req));
|
||||||
|
|
||||||
// Recurse to poll `self.in_flight`
|
// Immediately wake up to poll `self.in_flight`
|
||||||
self.poll_next(cx)
|
// (without this this stream becomes a zombie)
|
||||||
|
cx.waker().wake_by_ref();
|
||||||
|
Poll::Pending
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue