Skip to content

Commit a1e2e12

Browse files
N21: Added simple-async-local-executor (#601)
1 parent 2d53237 commit a1e2e12

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

content/news/021/index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,38 @@ Profiling is used by multiple projects including `gfx-hal`, `rafx`, and
333333

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

336+
### [simple-async-local-executor]
337+
338+
```rust
339+
let executor = Executor::default();
340+
let events = [executor.create_event_handle(), executor.create_event_handle()];
341+
342+
async fn wait_event(events: [EventHandle; 2], executor: Executor) {
343+
executor.event(&events[0]).await;
344+
executor.event(&events[1]).await;
345+
}
346+
347+
executor.spawn(wait_event(events.clone(), executor.clone()));
348+
assert_eq!(executor.step(), true);
349+
assert_eq!(executor.step(), true);
350+
executor.notify_event(&events[0]);
351+
assert_eq!(executor.step(), true);
352+
executor.notify_event(&events[1]);
353+
assert_eq!(executor.step(), false);
354+
```
355+
356+
[simple-async-local-executor] by [Enlightware]
357+
is a single-threaded polling-based executor suitable for use in games, embedded
358+
systems or WASM.
359+
360+
This executor can be useful when the number of tasks is small or
361+
if a small percentage is blocked. Being polling-based, in the general
362+
case it trades off efficiency for simplicity and does not require any
363+
concurrency primitives such as `Arc`, etc.
364+
365+
[simple-async-local-executor]: https://github.com/enlightware/simple-async-local-executor
366+
[Enlightware]: https://enlightware.ch
367+
336368
## Popular Workgroup Issues in Github
337369

338370
<!-- Up to 10 links to interesting issues -->

0 commit comments

Comments
 (0)