Skip to content
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
merged 4 commits into from
Aug 8, 2016
Merged

Add set of event queue composition functions #13

merged 4 commits into from
Aug 8, 2016

Conversation

geky
Copy link
Contributor

@geky geky commented Aug 7, 2016

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.

geky added 4 commits August 7, 2016 01:27
The equeue_background function requires only a user-provided update
function, which is called to indicate when the queue should be
dispatched.

The equeue_background function adds a new level of composability to the
event queue library. Allowing equeues to be easily backgrounded on
hardware timers or even be combined with existing event loops.
The equeue_chain function chains one queue onto a target queue.
Calling equeue_dispatch on the target queue will also dispatch events
on the target, however each queue uses their own buffers and events
are handled independently.

The equeue_chain adds a very powerful level of composability for
equeues freely built on the equeue_background function. This allows
multiple modules to own their own event queues while maintaining
composability on threadless systems.
Add set of event queue composition functions
Adds the following:
- EventQueue::background
- EventQueue::chain
@geky geky merged commit 242a8ec into master Aug 8, 2016
@geky geky deleted the backgrounding branch August 8, 2016 04:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant