Module: PerfectQueue::TaskMonitorHook

Defined in:
lib/perfectqueue/task_monitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#logObject

Returns the value of attribute log.



156
157
158
# File 'lib/perfectqueue/task_monitor.rb', line 156

def log
  @log
end

#runnerObject

Returns the value of attribute runner.



158
159
160
# File 'lib/perfectqueue/task_monitor.rb', line 158

def runner
  @runner
end

#task_monitorObject

Returns the value of attribute task_monitor.



157
158
159
# File 'lib/perfectqueue/task_monitor.rb', line 157

def task_monitor
  @task_monitor
end

Instance Method Details

#cancel_request!(*args, &block) ⇒ Object



181
182
183
184
185
186
# File 'lib/perfectqueue/task_monitor.rb', line 181

def cancel_request!(*args, &block)
  @log.info "cancel request task=#{self.key}" if @log
  @task_monitor.task_finished(self) {
    super(*args, &block)
  }
end

#finish!(*args, &block) ⇒ Object



160
161
162
163
164
165
# File 'lib/perfectqueue/task_monitor.rb', line 160

def finish!(*args, &block)
  @log.info "finished task=#{self.key}" if @log
  @task_monitor.task_finished(self) {
    super(*args, &block)
  }
end

#release!(*args, &block) ⇒ Object



167
168
169
170
171
172
# File 'lib/perfectqueue/task_monitor.rb', line 167

def release!(*args, &block)
  @log.info "release task=#{self.key}" if @log
  @task_monitor.task_finished(self) {
    super(*args, &block)
  }
end

#retry!(*args, &block) ⇒ Object



174
175
176
177
178
179
# File 'lib/perfectqueue/task_monitor.rb', line 174

def retry!(*args, &block)
  @log.info "retry task=#{self.key}" if @log
  @task_monitor.task_finished(self) {
    super(*args, &block)
  }
end

#update_data!(hash) ⇒ Object



188
189
190
191
192
193
# File 'lib/perfectqueue/task_monitor.rb', line 188

def update_data!(hash)
  @log.info "update data #{hash.inspect} task=#{self.key}" if @log
  @task_monitor.external_task_heartbeat(self) {
    super(hash)
  }
end