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

Version Path
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/rb-kqueue-0.2.3/lib/rb-kqueue/watcher/signal.rb
rb-kqueue-0.2.3 lib/rb-kqueue/watcher/signal.rb
rb-kqueue-0.2.2 lib/rb-kqueue/watcher/signal.rb
rb-kqueue-0.2.1 lib/rb-kqueue/watcher/signal.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rb-kqueue-0.2.0/lib/rb-kqueue/watcher/signal.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rb-kqueue-0.2.0/lib/rb-kqueue/watcher/signal.rb
rb-kqueue-0.2.0 lib/rb-kqueue/watcher/signal.rb
rb-kqueue-burke-0.1.0 lib/rb-kqueue/watcher/signal.rb
rb-kqueue-0.1.0 lib/rb-kqueue/watcher/signal.rb