Class Ruote::StorageHistory
In: lib/ruote/log/storage_history.rb
Parent: Object

Logs the ruote engine history to the storage underlying the worker.

Warning : don‘t use this history implementation when the storage is HashStorage. It will fill up your memory… Keeping history for a transient ruote is a bit overkill (IMHO).

using the StorageHistory

  engine.add_service(
    'history', 'ruote/log/storage_history', 'Ruote::StorageHistory')

  # ...

  process_history = engine.history.by_wfid(wfid0)

final note

By default, the history is an in-memory history (see Ruote::DefaultHistory) (and it is worthless when there are multiple workers).

Methods

accept?   by_date   by_process   by_wfid   clear!   new   on_msg   range   wfids  

Constants

DATE_REGEX = /!(\d{4}-\d{2}-\d{2})!/

Public Class methods

Public Instance methods

Returns all the history events for a given day.

Takes as argument whatever is a datetime when turned to a string and parsed.

Returns all the msgs for a given wfid (process instance id).

by_wfid(wfid)

Alias for by_process

The history system doesn‘t implement purge! so that when purge! is called on the engine, the history is not cleared.

Call this dangerous clear! method to clean out any history file.

This method is called by the worker via the context. Successfully processed msgs are passed here.

Returns an array [ most recent date, oldest date ] (Time instances).

Returns all the wfids for which there are history items (msgs) stored.

Protected Instance methods

This default implementation lets all the messages in.

Feel free to override this method in a subclass.

[Validate]