Skip to content

Commit eca7737

Browse files
committed
task: make poll methods of JoinSet public
My use-case can be seen here apache/datafusion#6449. I want to avoid needless Box::pin calls when I can just poll the underlying task.
1 parent 9eb3f5b commit eca7737

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tokio/src/task/join_set.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl<T: 'static> JoinSet<T> {
362362
/// This can happen if the [coop budget] is reached.
363363
///
364364
/// [coop budget]: crate::task#cooperative-scheduling
365-
fn poll_join_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Result<T, JoinError>>> {
365+
pub fn poll_join_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Result<T, JoinError>>> {
366366
// The call to `pop_notified` moves the entry to the `idle` list. It is moved back to
367367
// the `notified` list if the waker is notified in the `poll` call below.
368368
let mut entry = match self.inner.pop_notified(cx.waker()) {
@@ -419,7 +419,7 @@ impl<T: 'static> JoinSet<T> {
419419
/// [coop budget]: crate::task#cooperative-scheduling
420420
/// [task ID]: crate::task::Id
421421
#[cfg(tokio_unstable)]
422-
fn poll_join_next_with_id(
422+
pub fn poll_join_next_with_id(
423423
&mut self,
424424
cx: &mut Context<'_>,
425425
) -> Poll<Option<Result<(Id, T), JoinError>>> {

0 commit comments

Comments
 (0)