Class: BaseWorkerExtension

Inherits:
Object
  • Object
show all
Defined in:
lib/base_worker_extension.rb

Overview

base class for process pool extensions

it is not required that the extensions inherit from this class, it’s here mostly for convenience and documentation sake

Direct Known Subclasses

AnonymousExtension

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/base_worker_extension.rb', line 7

def logger
  @logger
end

#process_poolObject

Returns the value of attribute process_pool.



7
8
9
# File 'lib/base_worker_extension.rb', line 7

def process_pool
  @process_pool
end

Instance Method Details

#after(task, result) ⇒ Object

will be called after task gets executed



16
17
# File 'lib/base_worker_extension.rb', line 16

def after(task, result)
end

#around(task) ⇒ Object

will be called before task gets executed around is responsible for calling task.run, failing to do so might result in unpredictable behavior and failing to run a ProcessPool::EndTask will result in the process never ending



24
25
# File 'lib/base_worker_extension.rb', line 24

def around(task)
end

#before(task) ⇒ Object

will be called before task gets executed thowing :stop will halt the task execution process, no other filters will be executed for this task



12
13
# File 'lib/base_worker_extension.rb', line 12

def before(task)
end

#shutdownObject

will be called on worker shutdown



32
33
# File 'lib/base_worker_extension.rb', line 32

def shutdown    
end

#startupObject

will be called on worker startup, before executing any tasks



28
29
# File 'lib/base_worker_extension.rb', line 28

def startup
end