Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakkusakura/minimal-executor
https://github.com/jakkusakura/minimal-executor
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/jakkusakura/minimal-executor
- Owner: JakkuSakura
- Created: 2021-06-23T10:48:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T06:00:53.000Z (about 2 years ago)
- Last Synced: 2024-12-31T01:11:32.525Z (16 days ago)
- Language: Rust
- Size: 21.5 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
}```