make_cooperative

Function make_cooperative 

Source
pub fn make_cooperative(
    stream: Pin<Box<dyn RecordBatchStream<Item = Result<RecordBatch, DataFusionError>> + Send>>,
) -> Pin<Box<dyn RecordBatchStream<Item = Result<RecordBatch, DataFusionError>> + Send>>
Expand description

Wraps a SendableRecordBatchStream inside a CooperativeStream to enable cooperative multitasking. Since SendableRecordBatchStream is a dyn RecordBatchStream this requires the use of dynamic method dispatch. When the stream type is statically known, consider use the generic cooperative function to allow static method dispatch.