From 44d879a43c312f42b5d1d3d5766f2a0d825f39a8 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio/src/task/join_set.rs b/tokio/src/task/join_set.rs index 041b06cb60f..3393a9a6cdf 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,7 @@ impl JoinSet { /// [coop budget]: crate::task#cooperative-scheduling /// [task ID]: crate::task::Id #[cfg(tokio_unstable)] - fn poll_join_next_with_id( + pub fn poll_join_next_with_id( &mut self, cx: &mut Context<'_>, ) -> Poll>> {