Class: Nodule::Alarm

Inherits:
Base
  • Object
show all
Defined in:
lib/nodule/alarm.rb

Instance Attribute Summary

Attributes inherited from Base

#prefix, #read_count, #readers, #running, #topology

Instance Method Summary collapse

Methods inherited from Base

#add_reader, #add_readers, #clear!, #done?, #join_topology!, #output, #output!, #output?, #read_until, #require_read_count, #run, #run_readers, #stop, #stop!, #verbose, #wait, #wait_with_backoff

Constructor Details

#initialize(opts = {}) ⇒ Alarm

Returns a new instance of Alarm.



15
16
17
18
19
20
21
22
23
# File 'lib/nodule/alarm.rb', line 15

def initialize(opts={})
  if opts[:timeout]
    PosixAlarmImport.alarm(opts[:timeout])
  end

  Signal.trap("ALRM") { abort "Got SIGALRM. Aborting."; }

  super(opts)
end