Module: Jiggler::Job::ClassMethods

Defined in:
lib/jiggler/job.rb

Instance Method Summary collapse

Instance Method Details

#enqueue(*args) ⇒ Object



6
7
8
# File 'lib/jiggler/job.rb', line 6

def enqueue(*args)
  Enqueuer.new(self).enqueue(*args)
end

#enqueue_bulk(args_arr) ⇒ Object



19
20
21
# File 'lib/jiggler/job.rb', line 19

def enqueue_bulk(args_arr)
  Enqueuer.new(self).enqueue_bulk(args_arr)
end

#enqueue_in(seconds, *args) ⇒ Object



10
11
12
# File 'lib/jiggler/job.rb', line 10

def enqueue_in(seconds, *args)
  Enqueuer.new(self).enqueue_in(seconds, *args)
end

#job_options(queue: nil, retries: nil, retry_queue: nil) ⇒ Object



35
36
37
38
39
# File 'lib/jiggler/job.rb', line 35

def job_options(queue: nil, retries: nil, retry_queue: nil)
  @queue = queue || Jiggler::Config::DEFAULT_QUEUE
  @retries = retries || 0
  @retry_queue = retry_queue || queue
end

#queueObject



23
24
25
# File 'lib/jiggler/job.rb', line 23

def queue
  @queue || Jiggler::Config::DEFAULT_QUEUE
end

#retriesObject



31
32
33
# File 'lib/jiggler/job.rb', line 31

def retries
  @retries || 0
end

#retry_queueObject



27
28
29
# File 'lib/jiggler/job.rb', line 27

def retry_queue
  @retry_queue || Jiggler::Config::DEFAULT_QUEUE
end

#with_options(options) ⇒ Object

MyJob.with_options(queue: ‘custom’, retries: 3).enqueue(*args)



15
16
17
# File 'lib/jiggler/job.rb', line 15

def with_options(options)
  Enqueuer.new(self, options)
end