Sha256: aca90163bbd169de77de464f4cec98e015a285ac55cc1571c496a9e93e30c6c0
Contents?: true
Size: 828 Bytes
Versions: 9
Compression:
Stored size: 828 Bytes
Contents
module KQueue class Watcher # The {Watcher} subclass for events fired when a signal is received. # Signal events are watched via {Queue#watch_for_signal}. class Signal < Watcher # The name of the signal, e.g. "KILL" for SIGKILL. # # @return [String] attr_reader :name # The number of the signal, e.g. 9 for SIGKILL. # # @return [Fixnum] attr_reader :number # Creates a new signal Watcher. # # @private def initialize(queue, signal, callback) if signal.is_a?(String) @name = signal @number = Signal.list[signal] else @name = Signal.list.find {|_, n| n == signal}.first @number = signal end super(queue, @number, :signal, [], nil, callback) end end end end
Version data entries
9 entries across 9 versions & 4 rubygems