Class Ruote::DefaultHistory
In: lib/ruote/log/default_history.rb
Parent: Object

A default history implementation, only keeps the most recent stuff in memory.

This class includes Enumerable.

NOTE:

This default history is worthless when there are multiple workers. It only keeps track of the msgs processed by the worker in the same context. Msgs processed by other workers (in different Ruby runtimes) are not seen (they are tracked by the DefaultHistory next to those workers).

By default, this history keeps track of the latest 1‘000 msgs. This can be changed by passing a ‘history_max_size’ option to the storage when initializing ruote (‘history_max_size’ => 0) is acceptable.

Methods

all   by_date   by_process   by_wfid   clear!   each   new   on_msg   range   wfids  

Included Modules

Enumerable

Constants

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

Public Class methods

Public Instance methods

Returns all the msgs (events), most recent one is last.

Returns all the msgs (events) for a given wfid. (Well, all the msgs that are kept.

by_wfid(wfid)

Alias for by_process

Forgets all the stored msgs.

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 some piece of history is kept.

[Validate]