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:
parent
c1c3c349af
commit
e375cbef30
1 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue