6 releases

0.3.2 Dec 7, 2024
0.3.1 Nov 14, 2024
0.2.0 Nov 7, 2024
0.1.1 Oct 22, 2024

#734 in Asynchronous

Download history 188/week @ 2024-10-13 165/week @ 2024-10-20 18/week @ 2024-10-27 106/week @ 2024-11-03 230/week @ 2024-11-10 38/week @ 2024-11-17 3/week @ 2024-11-24 120/week @ 2024-12-01 46/week @ 2024-12-08 4/week @ 2024-12-15

143 downloads per month
Used in 2 crates

MIT/Apache

83KB
402 lines

test_executors

logo

This crate provides extremely simple, yet useful, async executors. They are primarily useful for writing unit tests without bringing in a full-blown executor such as tokio.

The executors are:

  • spin_on: polls a future in a busyloop on the current thread.
  • sleep_on: polls a future on the current thread, sleeping between polls.
  • spawn_on: spawns a future on a new thread, polling it there.

some_executor

This crate implements the some_executor trait for all executors, allowing them to be used in executor-agnostic code.

async_test

This crate provides a macro, async_test, allowing tests to be used with async functions, including support for wasm32 targets.


lib.rs:

This crate provides extremely simple, yet useful, async executors. They are primarily useful for writing unit tests without bringing in a full-blown executor such as tokio.

The executors are:

  • spin_on: polls a future in a busyloop on the current thread.
  • sleep_on: polls a future on the current thread, sleeping between polls.
  • spawn_on: spawns a future on a new thread, polling it there.

some_executor

This crate implements the some_executor trait for all executors, allowing them to be used in executor-agnostic code.

async_test

This crate provides a macro, async_test, allowing tests to be used with async functions, including support for wasm32 targets.

Blocks the calling thread until a future is ready.

Dependencies

~0.6–2.5MB
~43K SLoC