Class: BaseWorkerExtension
- Inherits:
-
Object
- Object
- BaseWorkerExtension
- 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
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#process_pool ⇒ Object
Returns the value of attribute process_pool.
Instance Method Summary collapse
-
#after(task, result) ⇒ Object
will be called after task gets executed.
-
#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.
-
#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.
-
#shutdown ⇒ Object
will be called on worker shutdown.
-
#startup ⇒ Object
will be called on worker startup, before executing any tasks.
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/base_worker_extension.rb', line 7 def logger @logger end |
#process_pool ⇒ Object
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 |
#shutdown ⇒ Object
will be called on worker shutdown
32 33 |
# File 'lib/base_worker_extension.rb', line 32 def shutdown end |
#startup ⇒ Object
will be called on worker startup, before executing any tasks
28 29 |
# File 'lib/base_worker_extension.rb', line 28 def startup end |