Sha256: bdf55a54c8d8349468459c7f2ce14016534bfdc3e5eea05b5a646dd3a175f677
Contents?: true
Size: 464 Bytes
Versions: 40
Compression:
Stored size: 464 Bytes
Contents
class Wire < Fiber # We cannot run this fiber explicitly because EM schedules it. Resuming the # current fiber on the next tick to let the reactor do work. def self.pass f = Fiber.current EM.next_tick { f.resume } Fiber.yield end def self.sleep(sec) EM::Synchrony.sleep(sec) end def initialize(&blk) super # Schedule run in next tick EM.next_tick { resume } end def join self.class.pass while alive? end end
Version data entries
40 entries across 39 versions & 10 rubygems