class EventMachine::Synchrony::MongoTimeoutHandler
Public Class Methods
timeout(op_timeout, ex_class, &block)
click to toggle source
# File lib/em-synchrony/mongo.rb, line 24 def self.timeout(op_timeout, ex_class, &block) f = Fiber.current timer = EM::Timer.new(op_timeout) { f.resume(nil) } res = block.call timer.cancel res end