Module: Async::Background::Job::ClassMethods

Defined in:
lib/async/background/job.rb

Instance Method Summary collapse

Instance Method Details

#options(**values) ⇒ Object



62
63
64
# File 'lib/async/background/job.rb', line 62

def options(**values)
  @options = Options.new(**values).to_h.compact
end

#perform_async(*args, options: {}) ⇒ Object



58
# File 'lib/async/background/job.rb', line 58

def perform_async(*args, options: {})     = Async::Background::Queue.enqueue(self, *args, options: options)

#perform_at(time, *args, options: {}) ⇒ Object



60
# File 'lib/async/background/job.rb', line 60

def perform_at(time, *args, options: {})  = Async::Background::Queue.enqueue_at(time, self, *args, options: options)

#perform_in(delay, *args, options: {}) ⇒ Object



59
# File 'lib/async/background/job.rb', line 59

def perform_in(delay, *args, options: {}) = Async::Background::Queue.enqueue_in(delay, self, *args, options: options)

#perform_now(*args) ⇒ Object



56
# File 'lib/async/background/job.rb', line 56

def perform_now(*args) = new.perform(*args)

#resolve_optionsObject



66
# File 'lib/async/background/job.rb', line 66

def resolve_options = @options || {}