In futures 0.1, I can use CpuPool
to spawn a reading task, then get the result by polling CpuFuture<...>
for each chunk, but seems this way not available in futures 0.2, the ThreadPool::run(...)
will block the thread until the task finish.
My thought is to wrap the oneshot::channel
, use the oneshot::Sender<io::Result<File, BytesMut>>
to get the reading result for each chunk. I want to know any other graceful way to do that.