Skip to content

Commit cc4a8cd

Browse files
committed
deprecate push method
1 parent cbfda98 commit cc4a8cd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

futures-util/src/stream/futures_ordered.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,19 @@ impl<Fut: Future> FuturesOrdered<Fut> {
129129
self.in_progress_queue.is_empty() && self.queued_outputs.is_empty()
130130
}
131131

132+
/// Push a future into the queue.
133+
///
134+
/// This function submits the given future to the internal set for managing.
135+
/// This function will not call `poll` on the submitted future. The caller
136+
/// must ensure that `FuturesOrdered::poll` is called in order to receive
137+
/// task notifications.
138+
#[deprecated]
139+
pub fn push(&mut self, future: Fut) {
140+
let wrapped = OrderWrapper { data: future, index: self.next_incoming_index };
141+
self.next_incoming_index += 1;
142+
self.in_progress_queue.push(wrapped);
143+
}
144+
132145
/// Pushes a future to the back of the queue.
133146
///
134147
/// This function submits the given future to the internal set for managing.

0 commit comments

Comments
 (0)