#async-task #progress-bar #yield #events

no-std yield-progress

Combined progress reporting and cooperative task yielding

6 releases

0.1.7 Jun 30, 2024
0.1.6 Apr 28, 2024
0.1.5 Dec 26, 2023
0.1.4 Sep 30, 2023
0.1.0 Aug 23, 2023

#146 in WebAssembly

Download history 125/week @ 2024-08-11 109/week @ 2024-08-18 62/week @ 2024-08-25 157/week @ 2024-09-01 59/week @ 2024-09-08 179/week @ 2024-09-15 148/week @ 2024-09-22 104/week @ 2024-09-29 61/week @ 2024-10-06 102/week @ 2024-10-13 74/week @ 2024-10-20 182/week @ 2024-10-27 204/week @ 2024-11-03 42/week @ 2024-11-10 43/week @ 2024-11-17 105/week @ 2024-11-24

401 downloads per month
Used in 8 crates (2 directly)

MIT/Apache

34KB
486 lines

YieldProgress

This library, yield-progress, provides the YieldProgress type, which allows a long-running async task to report its progress, while also yielding to the scheduler (e.g. for the single-threaded web/Wasm environment) and introducing cancellation points.

These things go together because the rate at which it makes sense to yield (to avoid event loop hangs) is similar to the rate at which it makes sense to report progress, at least for human interfaces.

Compatibility

  • YieldProgress is executor-independent; when it is constructed, the caller may provide a function for yielding using executor-specific mechanisms such as tokio::task::yield_now(), or may use the built-in simple yielder.
  • The library is no_std compatible if default features are disabled. See the library documentation for details on the consequences.

Project status and stability

yield-progress has been split out of my larger project all-is-cubes so that I can use it for other applications; its functionality and applicability may be limited, but I believe it is free of bugs.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0–260KB