Class Ruote::Tracker
In: lib/ruote/svc/tracker.rb
Parent: Object

The tracker service is used by the "listen" expression. This services sees all the msg processed by a worker and triggers any listener interested in a particular msg.

Look at the ListenExpression for more details.

Methods

Public Class methods

Public Instance methods

Adds a tracker (usually when a ‘listen’ expression gets applied).

The tracker_id may be nil (one will then get generated).

Returns the tracker_id.

The worker calls this method via the context after each successful msg processing.

The worker calls this method via the context before each msg gets processed.

Removes a tracker (usually when a ‘listen’ expression replies to its parent expression or is cancelled).

Protected Instance methods

Alters the msg, only called in "pre" mode.

Given a msg and a hash of conditions, returns true if the msg matches the conditions.

The method behind on_pre_msg and on_msg. Filters msgs against trackers. Triggers trackers if there is a match.

Removes a set of tracker ids and updated the tracker document.

Returns the trackers currently registered.

Note: this is called from on_pre_msg and on_msg, hence two times for a single msg. We trust the storage implementation to cache it for us.

Prepares the message that gets placed on the ruote msg queue.

[Validate]