Class: Rubee::SidekiqAsync

Inherits:
Object
  • Object
show all
Defined in:
lib/rubee/async/sidekiq_async.rb

Instance Method Summary collapse

Instance Method Details

#perform_async(**args) ⇒ Object



3
4
5
6
# File 'lib/rubee/async/sidekiq_async.rb', line 3

def perform_async(**args)
  options = serialize_options(args[:options])
  args[:_class].perform_async(*options)
end

#perform_at(interval, **args) ⇒ Object



8
9
10
11
# File 'lib/rubee/async/sidekiq_async.rb', line 8

def perform_at(interval, **args)
  options = serialize_options(args[:options])
  args[:_class].perform_at(interval, *options)
end

#perform_bulk(jobs_args) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/rubee/async/sidekiq_async.rb', line 22

def perform_bulk(jobs_args)
  jobs_args.map! do |args|
    options = serialize_options(args[:options])
    { args: options }
  end

  args[:_class].perform_bulk(jobs_args)
end

#perform_in(interval, **args) ⇒ Object



13
14
15
16
# File 'lib/rubee/async/sidekiq_async.rb', line 13

def perform_in(interval, **args)
  options = serialize_options(args[:options])
  args[:_class].perform_in(interval, *options)
end

#perform_later(interval, **args) ⇒ Object



18
19
20
# File 'lib/rubee/async/sidekiq_async.rb', line 18

def perform_later(interval, **args)
  perform_in(interval, **args)
end

#set(options, **args) ⇒ Object



31
32
33
34
# File 'lib/rubee/async/sidekiq_async.rb', line 31

def set(options, **args)
  serialized_options = serialize_options(args[:options])
  args[:_class].set(options).perform_async(*serialized_options)
end