Module: Axn::Async::Adapters::Sidekiq
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/axn/async/adapters/sidekiq.rb,
lib/axn/async/adapters/sidekiq/middleware.rb,
lib/axn/async/adapters/sidekiq/death_handler.rb,
lib/axn/async/adapters/sidekiq/retry_helpers.rb,
lib/axn/async/adapters/sidekiq/auto_configure.rb
Defined Under Namespace
Modules: AutoConfigure, DeathHandler, RetryHelpers Classes: ConfigurationError, Middleware
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
._running_in_background? ⇒ Boolean
11 12 13 |
# File 'lib/axn/async/adapters/sidekiq.rb', line 11 def self._running_in_background? defined?(::Sidekiq) && ::Sidekiq.server? end |
Instance Method Details
#perform(*args) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/axn/async/adapters/sidekiq.rb', line 64 def perform(*args) context = Axn::Internal::GlobalIdSerialization.deserialize(args.first) # Validate Sidekiq configuration once on first job execution in a real server context. # Skip validation when: # - Already validated # - In Sidekiq test mode (inline/fake) # - In a test environment (where Sidekiq may be stubbed) AutoConfigure.validate_configuration!(Axn.config.async_exception_reporting) unless AutoConfigure.skip_validation? result = self.class.call(**context) # Only re-raise unexpected exceptions so Sidekiq can retry. # Axn::Failure is a deliberate business decision (from fail!), not a transient error. # Per Sidekiq's ethos: "Sidekiq retries are for unexpected errors." raise result.exception if result.outcome.exception? result end |