Class: PerfectSched::Task

Inherits:
ScheduleWithMetadata show all
Includes:
Model
Defined in:
lib/perfectsched/task.rb

Instance Attribute Summary collapse

Attributes included from Model

#client

Attributes included from ScheduleMetadataAccessors

#attributes

Attributes inherited from Schedule

#key

Instance Method Summary collapse

Methods included from Model

#config

Methods inherited from ScheduleWithMetadata

#inspect

Methods included from ScheduleMetadataAccessors

#cron, #data, #delay, #message, #next_run_time, #next_time, #timezone, #type

Methods inherited from Schedule

#delete!, #exists?, #inspect, #metadata

Constructor Details

#initialize(client, key, attributes, scheduled_time, task_token) ⇒ Task

Returns a new instance of Task.



24
25
26
27
28
# File 'lib/perfectsched/task.rb', line 24

def initialize(client, key, attributes, scheduled_time, task_token)
  super(client, key, attributes)
  @scheduled_time = scheduled_time
  @task_token = task_token
end

Instance Attribute Details

#scheduled_timeObject (readonly)

Returns the value of attribute scheduled_time.



30
31
32
# File 'lib/perfectsched/task.rb', line 30

def scheduled_time
  @scheduled_time
end

Instance Method Details

#finish!(options = {}) ⇒ Object



40
41
42
# File 'lib/perfectsched/task.rb', line 40

def finish!(options={})
  @client.finish(@task_token, options)
end

#release!(options = {}) ⇒ Object



32
33
34
# File 'lib/perfectsched/task.rb', line 32

def release!(options={})
  @client.release(@task_token, options)
end

#retry!(options = {}) ⇒ Object



36
37
38
# File 'lib/perfectsched/task.rb', line 36

def retry!(options={})
  @client.retry(@task_token, options)
end