Skip to content

Commit 77a1849

Browse files
committed
Merge branch '342-stream-throttle' of github.com:Wassasin/async-std into 342-stream-throttle
2 parents a722de1 + 6f6d5e9 commit 77a1849

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/stream/stream/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ extension_trait! {
318318
#[doc = r#"
319319
Limit the amount of items yielded per timeslice in a stream.
320320
321+
This stream does not drop any items, but will only limit the rate at which items pass through.
321322
# Examples
322323
```
323324
# fn main() { async_std::task::block_on(async {

src/stream/stream/throttle.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ use crate::stream::Stream;
99
use crate::task::{Context, Poll};
1010

1111
pin_project! {
12-
/// A stream that only yields one element once every `duration`, and applies backpressure. Does not drop any elements.
12+
/// A stream that only yields one element once every `duration`.
13+
///
14+
/// This `struct` is created by the [`throttle`] method on [`Stream`]. See its
15+
/// documentation for more.
16+
///
17+
/// [`throttle`]: trait.Stream.html#method.throttle
18+
/// [`Stream`]: trait.Stream.html
1319
#[doc(hidden)]
1420
#[allow(missing_debug_implementations)]
1521
pub struct Throttle<S> {

0 commit comments

Comments
 (0)