This repository was archived by the owner on Aug 19, 2021. It is now read-only.
Add set of event queue composition functions #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds two new composition functions for composing multiple event queues:
EventQueue::background
- The background function requires only a user-provided update function, which is called to indicate when the queue should be dispatched.EventQueue::chain
- The chain function chains one queue onto a target queue. Calling dispatch on the target queue will also dispatch events on the target, however each queue uses their own buffers and events are handled independently.These two functions add a new level of composability to mbed-events. EventsQueues can be easily backgrounded on hardware timers, or even combined with existing event loops. Multiple, independent EventQueues can be combined to easily share a single thread of execution between module boundaries. These functions should add significant flexibility to how a user's system can be architected.