Module dharma::event_loop [] [src]

Implementation of main thread loop with notification listening.

EventLoop organizes work flow of a single thread. Independent logical parts of application called Modules can be freely added to given EventLoops creating flexible multi-threading framework. EventLoop contains one receiver which can be used to push events and data to event queue.

Modules are created inside new thread so do not have to implement Send. User passes only their constructors to EventLoopInfo structure which is context for creation on EventLoop.

If EventLoop is not enough or too much, one can make new loop by implementing Service trait.

Structs

EventLoop

Thread loop with event queue with communication over bridges.

EventLoopInfo

Context for creation of EventLoop.

ServiceInfo

Context for creation of Service.

Traits

Module

Module defines independent part of application. One module is bounded only to single thread. More modules may be run in the same thread. Modules do not share memory, communicate with signals.

ModuleConstructor

To avoid requirement for Module to be Send and Sync it is constructed by special trait object.

Service

Trait for all Services.

ServiceConstructor

To avoid requirement for Service to be Send and Sync it is constructed by special trait object.