module Interruptible::ClassMethods

class methods of Interruptible

Public Instance Methods

interruptible(signal = :interrupt, method_name) click to toggle source

marks a method as interruptible, once one of methods marked with it is interrupted, all other methods will not execute any more

# File lib/interruptible.rb, line 28
def interruptible(signal = :interrupt, method_name)
  alias_method :"uninterruptible_#{method_name}", method_name
  define_method method_name do |*params|
    interruptible(signal) do
      __send__(:"uninterruptible_#{method_name}", *params)
    end
  end
  method_name
end