#minecraft #oc-wasm #opencomputers

oc-wasm-futures

Futures that allow async/await to be used in OC-Wasm for a more ergonomic experience

6 releases (breaking)

0.6.0 Dec 30, 2022
0.5.0 Aug 14, 2022
0.4.0 May 14, 2022
0.3.0 May 8, 2022
0.1.0 Jul 26, 2021

#282 in Asynchronous

Download history 8/week @ 2022-10-17 25/week @ 2022-10-24 18/week @ 2022-10-31 24/week @ 2022-11-07 25/week @ 2022-11-14 13/week @ 2022-11-21 8/week @ 2022-11-28 14/week @ 2022-12-05 28/week @ 2022-12-12 16/week @ 2022-12-19 71/week @ 2022-12-26 26/week @ 2023-01-02 17/week @ 2023-01-09 9/week @ 2023-01-16 26/week @ 2023-01-23 60/week @ 2023-01-30

117 downloads per month
Used in 4 crates

GPL-3.0-only

47KB
582 lines

OC-Wasm-futures provides a collection of async futures for use in Rust code running on OpenComputers computers running the OC-Wasm architecture. These futures are designed to work with any async executor and provide more ergonomic ways to handle sleeping and making method calls.


lib.rs:

This crate provides a collection of async futures for making method calls and sleeping.

Features

The proper-waker feature, which is enabled by default, makes the sleep futures fully compliant with the Future specification. Disabling the feature uses an alternative implementation which only keeps track of the shortest deadline (rather than the deadlines of all in-progress sleeps); this reduces code size, but only works if your choice of executor polls all tasks on every wakeup (as certain simple executors do) rather than keeping a proper ready-queue and requiring each task to be woken by its own Waker.

Dependencies

~760KB
~15K SLoC