Class: God::DriverEvent

Inherits:
TimedEvent show all
Defined in:
lib/god/driver.rb

Overview

A DriverEvent is a TimedEvent with an associated Task and Condition. This is the primary mechanism for poll conditions to be scheduled.

Instance Attribute Summary

Attributes inherited from TimedEvent

#at

Instance Method Summary collapse

Methods inherited from TimedEvent

#<=>, #due?

Constructor Details

#initialize(delay, task, condition) ⇒ DriverEvent

Initialize a new DriverEvent.

delay - The Numeric delay for this event. task - The Task associated with this event. condition - The Condition associated with this event.



50
51
52
53
54
# File 'lib/god/driver.rb', line 50

def initialize(delay, task, condition)
  super(delay)
  @task = task
  @condition = condition
end

Instance Method Details

#handle_eventObject

Handle this event by invoking the underlying condition on the associated task.

Returns nothing.



60
61
62
# File 'lib/god/driver.rb', line 60

def handle_event
  @task.handle_poll(@condition)
end