Module forest_filecoin::utils::stream

source ·

Functions§

  • Decouple stream generation and stream consumption into separate threads, keeping not-yet-consumed elements in a bounded queue. This is similar to stream::buffered and sink::buffer. The key difference is that par_buffer is parallel rather than concurrent and will make use of multiple cores when both the stream and the stream consumer are CPU-bound. Because a new thread is spawned, the stream has to be Sync, Send and 'static.