Event Queue

About

Project Status:   Prototype | Development | Alpha | Beta | Production

A prototype of the LxEngine event queue.

The prototype event queue here demostrates how "events" can be chained together to create complex series of actions based on a specific time-line without relying on any busy-waiting or global dependencies between events.

In short, the event queue is simply a sorted queue of key, object pairs where the key is a time at which to process the object and the object itself is a simple functor (i.e. stateful function). By chaining and compositing events via "repeat", "sequence", "wait", and other meta-events complex behaior can be intuitively defined.

Table of Contents

Demo


          

The demo creates a two complex events: one that counts even numbers (once per second) and one that counts odd numbers (once per second).

The even and odd counters do not directly interact and instead rely on the event queue to properly time the events such that they are effectively interleaved.

Source

engine.js

script.js