Class: BackgroundWorker::WorkerExecution
- Inherits:
-
Object
- Object
- BackgroundWorker::WorkerExecution
- Defined in:
- lib/background_worker/worker_execution.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#worker ⇒ Object
readonly
Returns the value of attribute worker.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(worker, options) ⇒ WorkerExecution
constructor
A new instance of WorkerExecution.
Constructor Details
#initialize(worker, options) ⇒ WorkerExecution
Returns a new instance of WorkerExecution.
5 6 7 8 |
# File 'lib/background_worker/worker_execution.rb', line 5 def initialize(worker, ) @worker = worker @options = end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
3 4 5 |
# File 'lib/background_worker/worker_execution.rb', line 3 def method_name @method_name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/background_worker/worker_execution.rb', line 3 def @options end |
#worker ⇒ Object (readonly)
Returns the value of attribute worker.
3 4 5 |
# File 'lib/background_worker/worker_execution.rb', line 3 def worker @worker end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/background_worker/worker_execution.rb', line 10 def call worker.perform_now() report_implicitly_successful unless completed? rescue StandardError => e log_worker_error(e) BackgroundWorker.after_exception(e) ensure log_worker_finality end |