module InterruptibleSleep

Public Instance Methods

interrupt_sleep() click to toggle source
# File lib/metronome-odd/interruptible_sleep.rb, line 7
def interrupt_sleep
  @_sleep_interrupt.close if @_sleep_interrupt
end
interruptible_sleep(seconds) click to toggle source
# File lib/metronome-odd/interruptible_sleep.rb, line 2
def interruptible_sleep(seconds)
  @_sleep_check, @_sleep_interrupt = IO.pipe
  IO.select([@_sleep_check], nil, nil, seconds)
end