Sha256: e2c9935259235901617cec3475db173b327d900f3d3ca345ad859db8fa3f7bee
Contents?: true
Size: 544 Bytes
Versions: 10
Compression:
Stored size: 544 Bytes
Contents
# Traps all the signals {NAMES} that should be intercepted by a long-running background process. module CarrotRpc::ServerRunner::Signals # CONSTANTS # The name of the signals to trap. NAMES = %w(HUP INT QUIT TERM).freeze # Traps all {NAMES}. # # @yield [name] Block to call when the signal is trapped. # @yieldparam name [String] the name of the signal that was trapped # @yieldreturn [void] # @return [void] def self.trap NAMES.each do |name| Kernel.trap(name) do yield name end end end end
Version data entries
10 entries across 10 versions & 1 rubygems