Expand description
Concurrency/parallelism utilities
Structs§
- FutRunner
- A fut_runner for a single future type.
Either produced from the builder as a standalone fut_runner
with it’s own limits, or from the
FutRunnerShared
factory where it shares limits with other fut_runners produced by said factory. - FutRunner
Builder - A builder to configure either a standalone of shared fut_runner.
- FutRunner
Shared - A fut_runner producing factory that can be cloned and shares it’s limits with all other fut_runners spawned from this factory or any of it’s clones.
Statics§
- FUT_
RUNNER_ PRIORITY_ DEFAULT - The default priority of shared runners. By default everything has the highest priority.
Functions§
- hint_
stream_ cb - Rust can sometimes fail to type hint the stream_cb callback argument.
- new_
fut_ runner - Create a new builder for a standalone or shared fut_runner.
- run_
cpu_ intensive rayon
- The following link explains the distinction between normal tokio,
tokio::task::spawn_blocking
, and rayon. For most cases you think to usetokio::task::spawn_blocking
, but isn’t actual IO like file read/write that isn’t async, and actually CPU bound stuff, rayon should be used. It goes without saying, if you ever want to use anything from rayon likerayon::iter::ParallelIterator
, it should be insiderun_cpu_intensive
https://ryhl.io/blog/async-what-is-blocking/#the-rayon-crate