Skip to content

N21: Added simple-async-local-executor #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions content/news/021/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,36 @@ Profiling is used by multiple projects including `gfx-hal`, `rafx`, and

[profiling]: https://crates.io/crates/profiling

### [simple-async-local-executor]

```rust
let executor = Executor::default();
let events = [executor.create_event_handle(), executor.create_event_handle()];

async fn wait_event(events: [EventHandle; 2], executor: Executor) {
executor.event(&events[0]).await;
executor.event(&events[1]).await;
}

executor.spawn(wait_event(events.clone(), executor.clone()));
assert_eq!(executor.step(), true);
assert_eq!(executor.step(), true);
executor.notify_event(&events[0]);
assert_eq!(executor.step(), true);
executor.notify_event(&events[1]);
assert_eq!(executor.step(), false);
```

[simple-async-local-executor] by [Enlightware]
is a single-threaded polling-based executor suitable for use in games, embedded systems or WASM.

This executor can be useful when the number of tasks is small or if a small percentage is blocked.
Being polling-based, in the general case it trades off efficiency for simplicity and
does not require any concurrency primitives such as `Arc`, etc.

[simple-async-local-executor]: https://github.com/enlightware/simple-async-local-executor
[Enlightware]: https://enlightware.ch

## Popular Workgroup Issues in Github

<!-- Up to 10 links to interesting issues -->
Expand Down