Expand description
Zephyr work wrappers targeted for the Future
type.
The future is similar to our SimpleAction
, with a few additional features:
- The poll function returns an enum indicating that either it can be suspended, or that it is finished and has a result.
- The poll function takes a
Waker
which is used to “wake” the work item.
However, there is a bit of a semantic mismatch between work queues and Futures. Futures are effectively built with the assumption that the the waking will happen, by Rust code, at the time the event is ready. However, work queues expect the work to be queued immediately, with a “poll” indicating what kind of even the work. Work will be scheduled either based on one of these events, or a timeout.
Structs§
- An answer to a completed Future.
- A potentially running Work.
- A future that sleeps for a while.
- Futures will need to be able to set the events and timeout of this waker. Because the Waker is parameterized, they will not have access to the whole WorkWaker, but only this WakeInfo.
- Build a combiner for Future and a Zephyr work queue. This encapsulates the idea of starting a new thread of work, and is the basis of both the main
run
for work queues, as well as any calls to spawn that happen within the Future world.
Functions§
- Async sleep.
- Calculate the memory needed by scheduled work. This does not include the size of the Answer (which can be dropped).