miniloop - simple asynchronous executor
This repository is created as an attempt to clarify some more low-level details about how things work in Rust asynchronous world.
The miniloop executor creates a statically allocated list of tasks. That number should be available upon a crate
build:
MINILOOP_TASK_ARRAY_SIZE: default value is1which means you can schedule a single task within the executor. To override that just define an environment variable with the number of tasks you plan to use in your application.
Configuration
You can set up the environment variable in a shell prior to running the cargo build command:
- Linux
export MINILOOP_TASK_ARRAY_SIZE=10 - Windows
$env:MINILOOP_TASK_ARRAY_SIZE = 10
Or you can use configurable environment feature by
creating a .cargo/config.toml file with the following content:
[]
= "10"
miniloop in action
Create your tasks on the stack, add them to the executor and enjoy!
use Executor;
use yield_me;
async