Skip to main content

pull_decode_on_thread

Function pull_decode_on_thread 

Source
pub fn pull_decode_on_thread<'a, R, S, Src, C>(
    run: R,
    sink: S,
    source: &'a mut Src,
    compute: C,
    pulse: Option<SharedPulse>,
) -> impl Future<Output = Result<(OutputInfo, S), AsyncDriveError<BoxedError>>> + Send + 'a
where R: FnOnce(&mut dyn DynReadAt, &mut dyn DecodeRowSink) -> Result<OutputInfo, BoxedError> + Send + 'static, S: DecodeRowSink + Send + 'static, Src: AsyncSource + ?Sized, C: Compute + 'a,
Expand description

Run a pull-native decode on one compute thread. run receives a DynReadAt whose reads block on source, so a codec written against push_decoder_from_source streams from an async transport, with read_many_at becoming one concurrent AsyncSource::read_ranges.

pulse cancels at the next read: each read checks it, and the wait for the reply re-checks it. Row progress is whatever the sink observes; the bridge cannot see rows written by code it does not drive.