Class: Zenaton::Tasks::Wait

Inherits:
Interfaces::Task show all
Includes:
Zenaton::Traits::WithTimestamp, Zenaton::Traits::Zenatonable
Defined in:
lib/zenaton/tasks/wait.rb

Overview

Class for creating waiting tasks

Constant Summary

Constants included from Zenaton::Traits::WithTimestamp

Zenaton::Traits::WithTimestamp::MODE_AT, Zenaton::Traits::WithTimestamp::MODE_MONTH_DAY, Zenaton::Traits::WithTimestamp::MODE_TIMESTAMP, Zenaton::Traits::WithTimestamp::MODE_WEEK_DAY, Zenaton::Traits::WithTimestamp::WEEKDAYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Zenaton::Traits::Zenatonable

#dispatch, #execute, #schedule

Methods included from Zenaton::Traits::WithTimestamp

#_get_timestamp_or_duration

Methods included from Zenaton::Traits::WithDuration

#_get_duration

Methods inherited from Interfaces::Task

#context, #on_error_retry_delay

Constructor Details

#initialize(event = nil) ⇒ Wait

Creates a new wait task and validates the event given

Parameters:

  • event (Class, String) (defaults to: nil)

Raises:



21
22
23
24
# File 'lib/zenaton/tasks/wait.rb', line 21

def initialize(event = nil)
  raise ExternalError, error unless valid_param(event)
  @event = event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



14
15
16
# File 'lib/zenaton/tasks/wait.rb', line 14

def event
  @event
end

Instance Method Details

#handleObject

NOOP: No waiting when executing locally



27
# File 'lib/zenaton/tasks/wait.rb', line 27

def handle; end