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.



41
42
43
44
# File 'lib/axn/async/exception_reporting.rb', line 41

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

Instance Method Details

#classObject



54
55
56
# File 'lib/axn/async/exception_reporting.rb', line 54

def class
  @action_class
end

#log(message) ⇒ Object



46
47
48
# File 'lib/axn/async/exception_reporting.rb', line 46

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

#resultObject



50
51
52
# File 'lib/axn/async/exception_reporting.rb', line 50

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