Module: Sidetiq::Actor

Included in:
Clock, Handler
Defined in:
lib/sidetiq/actor.rb,
lib/sidetiq/actor/clock.rb,
lib/sidetiq/actor/handler.rb

Defined Under Namespace

Classes: Clock, Handler

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


3
4
5
6
# File 'lib/sidetiq/actor.rb', line 3

def self.included(base)
  base.__send__(:include, Celluloid)
  base.finalizer :sidetiq_finalizer
end

Instance Method Details

#initialize(*args, &block) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/sidetiq/actor.rb', line 8

def initialize(*args, &block)
  log_call "initialize"

  super

  # Link to Sidekiq::Manager when running in server-mode. In most
  # cases the supervisor is booted before Sidekiq has launched
  # fully, so defer this.
  if Sidekiq.server?
    after(0.1) { link_to_sidekiq_manager }
  end
end