Class: ActiveInteraction::Extras::Sidekiq::ConfiguredJob

Inherits:
ActiveJob::ConfiguredJob
  • Object
show all
Defined in:
lib/active_interaction/extras/sidekiq.rb

Instance Method Summary collapse

Instance Method Details

#perform_later(*args) ⇒ Object Also known as: run!, run



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/active_interaction/extras/sidekiq.rb', line 51

def perform_later(*args)
  args = ActiveJob::Arguments.serialize(args)
  scope = @job_class.set(@options.except(:wait, :wait_until))

  if @job_class.sidekiq_options['encrypt']
    args.prepend(nil)
  end

  if @options[:wait]
    scope.perform_in @options[:wait], *args
  elsif @options[:wait_until]
    scope.perform_at @options[:wait_until], *args
  else
    scope.perform_async *args
  end
end

#perform_now(*args) ⇒ Object



47
48
49
# File 'lib/active_interaction/extras/sidekiq.rb', line 47

def perform_now(*args)
  @job_class.run!(*args)
end