Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jakkusakura/minimal-executor


https://github.com/jakkusakura/minimal-executor

Last synced: about 6 hours ago
JSON representation

Awesome Lists containing this project

README

        

# minimal-executor
This is an async executor tailored from futures-executor. It is meant to be as overheadless as possible.

Can be used without std
```toml
minimal-executor = { version = "0.3.0", default-features = false }
```
# Basic usage
You can use minimal-executor in three ways:
`LocalPool`, `poll_fn` and `poll_on`. They are almost the same as those in `futures`, but lighter.
```rust
fn run_until_single_future() {
let mut cnt = 0;

{
let mut pool = LocalPool::new();
let fut = lazy(|_| {
cnt += 1;
});
pool.spawn(fut.boxed_local());
pool.poll_once();
}

assert_eq!(cnt, 1);
}

```