File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,19 @@ unsafe impl Sync for Waker {}
218218
219219impl Waker {
220220 /// Wake up the task associated with this `Waker`.
221+ ///
222+ /// As long as the runtime keeps running and the task is not finished, it is
223+ /// guaranteed that each invocation of `wake` (or `wake_by_ref`) will be followed
224+ /// by at least one `poll` of the task to which this `Waker` belongs. This makes
225+ /// it possible to temporarily yield to other tasks while running potentially
226+ /// unbounded processing loops.
227+ ///
228+ /// Note that the above implies that multiple wake-ups may be coalesced into a
229+ /// single `poll` invocation by the runtime.
230+ ///
231+ /// Also note that yielding to competing tasks is not guaranteed: it is the
232+ /// executor’s choice which task to run and the executor may choose to run the
233+ /// current task again.
221234 #[ inline]
222235 #[ stable( feature = "futures_api" , since = "1.36.0" ) ]
223236 pub fn wake ( self ) {
You can’t perform that action at this time.
0 commit comments