This module contains Ibid’s startup code, plugin, source, config, and DB loading as well as the Event dispatcher.
The Ibid Event dispatcher.
Run callable after delay seconds, passing it oldevent and *args and *kwargs.
Returns a twisted.internet.base.DelayedCall.
Can be used in plugins instead of blocking in sleep.
- ibid.core._process(event)¶
The core of the dispatcher, must be called from a worker thread.
This function takes event and passes it to the process() function in each processor, in order of increasing priority.
After each Processor, any unclean SQLAlchemy sessions are committed and exceptions logged.
Any responses attached to event are dispatched to their destination sources.
- ibid.core.send(response)¶
- Dispatches response to the appropriate source.
- ibid.core.dispatch(event)¶
- Called by sources to dispatch event. Calls _process(), deferred to a thread, and returns the twisted.internet.defer.Deferred.
- ibid.core.delayed_call(callable, event, *args, **kwargs)¶
- The method called by call_later(), in a thread, to call callable, then _process() on event.
- ibid.core.delayed_response(event)¶
- Dispatches responses from delayed_call().
The center of Ibid’s bootstrap process, the reloader loads plugins and processors. They can be reloaded at any time.
Load all enabled sources, setting the service parents to service.
Sources can be disabled by setting the configuration key service.``disabled = True``.
Load all enabled processors, according to the rules in load_processor().
load specifies the plugins to force loading, noload plugins to skip loading, and autoload whether to load everything by default. If these parameters are not supplied or are None, they will be looked up as configuration keys in the plugins block.
The DatabaseManager is responsible for loading databases (usually only one, 'ibid'), and is a dict of database to sqlalchemy.orm.scoping.ScopedSessions.
Load the database of name name.
Echoing is configured by debugging.sqlalchemy_echo.
Databases are configured as sanely as possible: