Class: Axn::Async::ExceptionReporting::DiscardedJobAction

Inherits:
Object
  • Object
show all
Defined in:
lib/axn/async/exception_reporting.rb

Overview

Proxy action for discarded/dead job reporting that mimics an Axn action instance. Provides the interface expected by on_exception handlers.

Instance Method Summary collapse

Constructor Details

#initialize(action_class, exception) ⇒ DiscardedJobAction

Returns a new instance of DiscardedJobAction.



120
121
122
123
# File 'lib/axn/async/exception_reporting.rb', line 120

def initialize(action_class, exception)
  @action_class = action_class
  @exception = exception
end

Instance Method Details

#classObject



133
134
135
# File 'lib/axn/async/exception_reporting.rb', line 133

def class
  @action_class
end

#log(message) ⇒ Object



125
126
127
# File 'lib/axn/async/exception_reporting.rb', line 125

def log(message)
  Axn.config.logger.warn("[Axn::DiscardedJob] #{message}")
end

#resultObject



129
130
131
# File 'lib/axn/async/exception_reporting.rb', line 129

def result
  @discarded_job_result ||= DiscardedJobResult.new(@exception)
end