From 8545db58ff27d51841d5ecf32f26f78a198d24d4 Mon Sep 17 00:00:00 2001 From: Nicolae Vartolomei Date: Thu, 25 May 2023 21:49:53 +0100 Subject: [PATCH] task: make poll methods of JoinSet public My use-case can be seen here https://github.com/apache/arrow-datafusion/pull/6449. I want to avoid needless Box::pin calls when I can just poll the underlying task. --- tokio/src/task/join_set.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tokio/src/task/join_set.rs b/tokio/src/task/join_set.rs index 041b06cb60f..4eb15a24d5f 100644 --- a/tokio/src/task/join_set.rs +++ b/tokio/src/task/join_set.rs @@ -362,7 +362,7 @@ impl JoinSet { /// This can happen if the [coop budget] is reached. /// /// [coop budget]: crate::task#cooperative-scheduling - fn poll_join_next(&mut self, cx: &mut Context<'_>) -> Poll>> { + pub fn poll_join_next(&mut self, cx: &mut Context<'_>) -> Poll>> { // The call to `pop_notified` moves the entry to the `idle` list. It is moved back to // the `notified` list if the waker is notified in the `poll` call below. let mut entry = match self.inner.pop_notified(cx.waker()) { @@ -419,7 +419,8 @@ impl JoinSet { /// [coop budget]: crate::task#cooperative-scheduling /// [task ID]: crate::task::Id #[cfg(tokio_unstable)] - fn poll_join_next_with_id( + #[cfg_attr(docsrs, doc(cfg(tokio_unstable)))] + pub fn poll_join_next_with_id( &mut self, cx: &mut Context<'_>, ) -> Poll>> {