lib/async_fu.rb in amirka-async-fu-1.2.1 vs lib/async_fu.rb in amirka-async-fu-1.4.0
- old
+ new
@@ -1,28 +1,22 @@
require 'fastthread'
class AsyncFu
-
def initialize(obj = nil)
@class = obj || self
at_exit{
unless @exit
until Thread.list.size == 1 do Thread.pass end
end
}
end
def method_missing(name, *args, &block)
- if @class.respond_to?(name)
Thread.new{
@class.send name, *args, &block
}
- else
- @class.send name, *args, &block
- end
end
def exit
@exit = true
end
def self.method_added(method)
private method
end
-
end
\ No newline at end of file