1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

rdoc new stuff

This commit is contained in:
Mike Perham 2014-03-23 15:44:37 -07:00
parent c1c3c349af
commit e375cbef30

View file

@ -118,10 +118,25 @@ module Sidekiq
self.options[:poll_interval] = interval
end
# Register a proc to handle any error which occurs within the Sidekiq process.
#
# Sidekiq.configure_server do |config|
# config.error_handlers << Proc.new {|ex,ctx_hash| MyErrorService.notify(ex, ctx_hash) }
# end
#
# The default error handler logs errors to Sidekiq.logger.
def self.error_handlers
self.options[:error_handlers]
end
# Register a block to run at a point in the Sidekiq lifecycle.
# :startup, :quiet or :shutdown are valid events.
#
# Sidekiq.configure_server do |config|
# config.on(:shutdown) do
# puts "Goodbye cruel world!"
# end
# end
def self.on(event, &block)
raise ArgumentError, "Symbols only please: #{event}" if !event.is_a?(Symbol)
raise ArgumentError, "Invalid event name: #{event}" if !options[:lifecycle_events].keys.include?(event)