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

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

Instance Method Summary collapse

Instance Method Details

#options(**values) ⇒ Object



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

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

#perform_async(*args, options: EMPTY_OPTIONS) ⇒ Object



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

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

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



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

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

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



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

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

#perform_now(*args) ⇒ Object



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

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

#queue_optionsObject



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

def queue_options = @options || EMPTY_OPTIONS

#resolve_optionsObject



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

def resolve_options = @options || {}