Module: SidekiqSimpleDelay

Defined in:
lib/sidekiq_simple_delay.rb,
lib/sidekiq_simple_delay/utils.rb,
lib/sidekiq_simple_delay/version.rb,
lib/sidekiq_simple_delay/delay_worker.rb,
lib/sidekiq_simple_delay/delay_methods.rb,
lib/sidekiq_simple_delay/generic_proxy.rb

Overview

Sidekiq delay functionality with some restrictions

Defined Under Namespace

Modules: DelayMethods Classes: Proxy, SimpleDelayedWorker, Utils

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.enable_delay!Object

Adds simple_delay class methods to all classes


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

def enable_delay!
  enable_delay_instance!(Module)
end

.enable_delay_class!(klass) ⇒ Object

Adds simple_delay class methods to a class

Parameters:

  • klass (Class)

    Class to add simple_delay class methods to

Raises:

  • (ArgumentError)

17
18
19
20
21
# File 'lib/sidekiq_simple_delay.rb', line 17

def enable_delay_class!(klass)
  raise ArgumentError, 'klass must be a Class' unless klass.class.is_a?(Class)

  klass.__send__(:extend, SidekiqSimpleDelay::DelayMethods)
end

.enable_delay_instance!(klass) ⇒ Object

Adds simple_delay instance methods to class

Parameters:

  • klass (Class)

    Class to add simple_delay instance methods to

Raises:

  • (ArgumentError)

26
27
28
29
30
# File 'lib/sidekiq_simple_delay.rb', line 26

def enable_delay_instance!(klass)
  raise ArgumentError, 'klass must be a Class' unless klass.class.is_a?(Class)

  klass.__send__(:include, SidekiqSimpleDelay::DelayMethods)
end