mentat.daemon.component.storage module

Daemon component capable of storing IDEA messages into persistent storage. Currently only PostgreSQL database is supported.

It is dependent on services of following modules:

The implementation is based on pyzenkit.zendaemon.ZenDaemonComponent.

class mentat.daemon.component.storage.StorageDaemonComponent(**kwargs)[source]

Bases: ZenDaemonComponent

Daemon component capable of storing IDEA messages into database.

EVENT_DBH_COMMIT = 'dbh_commit'
EVENT_LOG_STATISTICS = 'log_statistics'
EVENT_MSG_PROCESS = 'message_process'
EVENT_START = 'start'
EVENT_STOP = 'stop'
STATS_CNT_COMMITS_THRESHOLD = 'cnt_cis_threshold'
STATS_CNT_COMMITS_TIMEOUT = 'cnt_cis_timeout'
STATS_CNT_COMMIT_THRESHOLD = 'cnt_eci_threshold'
STATS_CNT_COMMIT_TIMEOUT = 'cnt_eci_timeout'
STATS_CNT_ERRORS = 'cnt_errors'
STATS_CNT_STORED = 'cnt_stored'
cbk_event_database_commit(daemon, args)[source]

Check, whether there are any messages waiting to be committed for greater than configured time period. Commit them if necessary to avoid loss of data.

cbk_event_log_statistics(daemon, args)[source]

Periodical processing statistics logging.

cbk_event_message_process(daemon, args)[source]

Store the message into the persistent storage.

cbk_event_start(daemon, args)[source]

Start the component.

cbk_event_stop(daemon, args)[source]

Stop the component.

get_events()[source]

Get the list of event names and their appropriate callback handlers.

setup(daemon)[source]

Perform component setup.