module Mimi

Asynchronous processing of trapped signals

Example:

logger = Logger.new(STDOUT)

trap('INT') do
  logger.warn 'Interrupted' # => (ThreadError) can't be called from trap context
  # shutdown gracefully ...
end

Solution:

logger = Logger.new(STDOUT)

Mimi::Signal.trap('INT') do
  logger.warn 'Interrupted' # works!
  # shutdown gracefully ...
end

Public Class Methods

queue() click to toggle source
# File lib/mimi/signal.rb, line 84
def self.queue
  @queue ||= Queue.new
end