system architecture

Finchan is a event system framework, its main modules are Event, EventSource, Dispatcher, Subscribers, env and ExtManager.

concept

The Event is the input manner for finchan.

The EventSource is the original input for the system, it simulate the real world’s things to Event as input.

The Dispatcher is the engine of the system, it manage all EventSource, all event Subscriber, and dispath the events generated by EventSource or Subscriber, call the Subscriber’s callback.

The Subscriber is event subscriber, it subscriber event with a callback function, when the event occurs, the Dispatcher dispatch the event and call the callback function. The Subscriber can do anything with the callback function, include generate new events.

The env is global environment for the system, you can access it just by from finchan.env import env, you can access environment variable setted by other modules, or set your own environment variable.

the ExtManager manage all extensions for finchan.

Interfaces

kvstore

kvstore is persistent storage for finchan, finchan framework just specified the interface for kvstore, the implemention is done by extensions.

EventSource

The EventSource defines the interface to implent an EventSource, finchan system include a TimerSource, if you need other EventSource, you should write an extension for finchan, or check finchan_exts first.

Write an extension for finchan

refer Extend finchan.