Sha256: bf9baa637a9098709d59ebfb66c92a2cdc233095375492e72b21e4d32046eb06
Contents?: true
Size: 1.02 KB
Versions: 20
Compression:
Stored size: 1.02 KB
Contents
module OverSIP # This module is intended for 3rd party modules that need custom code to be # executed when OverSIP is started, reloaded or terminated. # module SystemCallbacks extend ::OverSIP::Logger @log_id = "SystemCallbacks" class << self attr_reader :on_started_callbacks attr_reader :on_terminated_callbacks attr_reader :on_reload_callbacks end @on_started_callbacks = [] @on_terminated_callbacks = [] @on_reload_callbacks = [] def self.on_started pr=nil, &bl block = pr || bl raise ::ArgumentError, "no block given" unless block.is_a? ::Proc @on_started_callbacks << block end def self.on_terminated pr=nil, &bl block = pr || bl raise ::ArgumentError, "no block given" unless block.is_a? ::Proc @on_terminated_callbacks << block end def self.on_reload pr=nil, &bl block = pr || bl raise ::ArgumentError, "no block given" unless block.is_a? ::Proc @on_reload_callbacks << block end end end
Version data entries
20 entries across 20 versions & 2 rubygems