pub fn gpu_stage<I, O, F, Fut>(
source: Source<I>,
parallelism: usize,
f: F,
) -> Source<O>Expand description
Apply an async GPU stage with the given degree of parallelism.
Ordering is preserved (akka.net’s SelectAsync).
§Example
ⓘ
let (tx, rx) = tokio::sync::mpsc::unbounded_channel::<f32>();
let s = source_from_unbounded(rx);
let s = gpu_stage::<f32, f32, _, _>(s, 4, |x| async move { x * 2.0 });
let out = Sink::collect(s).await;