dfir_lang/graph/ops/
resolve_futures_ordered.rs

1use syn::Ident;
2
3use super::{
4    resolve_futures::resolve_futures_writer, OperatorCategory, OperatorConstraints, RANGE_0, RANGE_1
5};
6
7/// Given an incoming stream of `F: Future`, sends those futures to the executor being used
8/// by the DFIR runtime. Yields the results of each future in the same order as the futures are
9/// received, so the output will always be blocked on the first remaining unresolved future.
10/// However, multiple futures may be spawned concurrently so there is no guarantee on when they are
11/// executed.
12pub const RESOLVE_FUTURES_ORDERED: OperatorConstraints = OperatorConstraints {
13    name: "resolve_futures_ordered",
14    categories: &[OperatorCategory::Map],
15    hard_range_inn: RANGE_1,
16    soft_range_inn: RANGE_1,
17    hard_range_out: RANGE_1,
18    soft_range_out: RANGE_1,
19    num_args: 0,
20    persistence_args: RANGE_0,
21    type_args: RANGE_0,
22    is_external_input: false,
23    has_singleton_output: false,
24    flo_type: None,
25    ports_inn: None,
26    ports_out: None,
27    input_delaytype_fn: |_| None,
28    write_fn: move |wc, _| resolve_futures_writer(Ident::new("FuturesOrdered", wc.op_span),
29    Ident::new("push_back", wc.op_span), 
30    wc)
31};