module Sidetiq::Actor

Public Class Methods

included(base) click to toggle source
# File lib/sidetiq/actor.rb, line 3
def self.included(base)
  base.__send__(:include, Celluloid)
  base.finalizer :sidetiq_finalizer
end
new(*args, &block) click to toggle source
Calls superclass method
# 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

Private Instance Methods

log_call(call) click to toggle source
# File lib/sidetiq/actor.rb, line 34
def log_call(call)
  info "#{self.class.name} id: #{object_id} #{call}"
end
sidetiq_finalizer() click to toggle source
# File lib/sidetiq/actor.rb, line 23
def sidetiq_finalizer
  log_call "shutting down ..."
end