Class God::Task
In: lib/god/task.rb
Parent: Object

Methods

Attributes

autostart  [W]  Public: Sets whether the task should autostart when god starts. Defaults to true (enabled).
behaviors  [RW]  api
directory  [RW]  api
driver  [RW]  Gets/Sets the Driver for this task.
group  [RW]  Public: Gets/Sets the String group name of the task.
initial_state  [RW]  Public: Gets/Sets the Symbol initial state of the state machine.
interval  [RW]  Public: Gets/Sets the Numeric default interval to be used between poll events.
metrics  [RW]  api
name  [RW]  Public: Gets/Sets the String name of the task.
state  [RW]  api
valid_states  [RW]  Public: Gets/Sets the Array of Symbol valid states for the state machine.

Public Class methods

Public Instance methods

Perform the given action.

a - The Symbol action. c - The Condition.

Returns this Task.

Returns true if autostart is enabled, false if not.

Convert the given input into canonical hash form which looks like:

{ true => :state } or { true => :state, false => :otherstate }

to - The Symbol or Hash destination.

Returns the canonical Hash.

Format the destination specification for use in debug logging.

metric - The Metric. condition - The Condition.

Returns the formatted String.

Asynchronously evaluate and handle the given event condition. Handles logging notifications, and moving to the new state if necessary.

condition - The Condition to handle.

Returns nothing.

Evaluate and handle the given poll condition. Handles logging notifications, and moving to the new state if necessary.

condition - The Condition to handle.

Returns nothing.

Public: Define a lifecycle handler. Conditions that belong to a lifecycle are active as long as the process is being monitored.

Returns nothing.

Log info about the condition and return the list of messages logged.

watch - The Watch. metric - The Metric. condition - The Condition. result - The Boolean result of the condition test evaluation.

Returns the Array of String messages.

Enable monitoring.

Returns nothing.

Move to the given state.

to_state - The Symbol representing the state to move to.

Returns this Task.

Notify all recipients of the given condition with the specified message.

condition - The Condition. message - The String message to send.

Returns nothing.

Initialize the metrics to an empty state.

Returns nothing.

Registration

Public: Define a transition handler which consists of a set of conditions

start_states - The Symbol or Array of Symbols start state(s). end_states - The Symbol or Hash end states.

Yields the Metric for this transition.

Returns nothing.

Notify the Driver that an EventCondition has triggered.

condition - The Condition.

Returns nothing.

Determine whether a trigger happened.

metric - The Metric. result - The Boolean result from the condition‘s test.

Returns Boolean

Disable monitoring.

Returns nothing.

Verify that the minimum set of configuration requirements has been met.

Returns true if valid, false if not.

[Validate]