Module: GoodJob::CurrentExecution
- Defined in:
- lib/good_job/current_execution.rb
Overview
Thread-local attributes for passing values from Instrumentation. (Cannot use ActiveSupport::CurrentAttributes because ActiveJob resets it)
Class Attribute Summary collapse
-
.error_on_discard ⇒ Exception?
Error captured by discard_on.
-
.error_on_retry ⇒ Exception?
Error captured by retry_on.
Class Method Summary collapse
-
.process_id ⇒ Integer
Current process ID.
-
.reset ⇒ void
Resets attributes.
-
.thread_name ⇒ String
Current thread name.
Class Attribute Details
.error_on_discard ⇒ Exception?
Error captured by discard_on
18 |
# File 'lib/good_job/current_execution.rb', line 18 thread_mattr_accessor :error_on_discard |
.error_on_retry ⇒ Exception?
Error captured by retry_on
12 |
# File 'lib/good_job/current_execution.rb', line 12 thread_mattr_accessor :error_on_retry |
Class Method Details
.process_id ⇒ Integer
Returns Current process ID.
28 29 30 |
# File 'lib/good_job/current_execution.rb', line 28 def self.process_id Process.pid end |
.reset ⇒ void
This method returns an undefined value.
Resets attributes
22 23 24 25 |
# File 'lib/good_job/current_execution.rb', line 22 def self.reset self.error_on_retry = nil self.error_on_discard = nil end |
.thread_name ⇒ String
Returns Current thread name.
33 34 35 |
# File 'lib/good_job/current_execution.rb', line 33 def self.thread_name (Thread.current.name || Thread.current.object_id).to_s end |