@@ -32,7 +32,7 @@ macro_rules! doc {
32
32
///
33
33
/// [`tokio::spawn`]: crate::spawn
34
34
///
35
- /// # Fairness
35
+ /// # Poll Ordering
36
36
///
37
37
/// By default, `join!`'s generated future rotates which contained
38
38
/// future is polled first whenever it is woken.
@@ -44,12 +44,11 @@ macro_rules! doc {
44
44
/// You may want this if your futures may interact in a way where known polling order is significant.
45
45
///
46
46
/// But there is an important caveat to this mode. It becomes your responsibility
47
- /// to ensure that the polling order of your futures is fair . If for example you
48
- /// are joining a stream and a shutdown future, and the stream has a
49
- /// huge volume of messages that takes a long time to finish processing per poll , you should
47
+ /// to ensure that the polling order of your futures is reasonable . If for example you
48
+ /// are joining a long-running server future with a shutdown future, and you want to make
49
+ /// sure that no new requests are dispatched following a shutdown , you should
50
50
/// place the shutdown future earlier in the `join!` list to ensure that it is
51
- /// always polled, and will not be delayed due to the stream future taking a long time to return
52
- /// `Poll::Pending`.
51
+ /// always polled first.
53
52
///
54
53
/// # Examples
55
54
///
@@ -225,8 +224,8 @@ doc! {macro_rules! join {
225
224
( ) => { async { } . await }
226
225
} }
227
226
228
- #[ derive( Default , Debug ) ]
229
227
/// Rotates by one every [`Self::num_skip`] call up to COUNT - 1.
228
+ #[ derive( Default , Debug ) ]
230
229
pub struct Rotator < const COUNT : u32 > {
231
230
next : u32 ,
232
231
}
0 commit comments