Sha256: 0a7c57cb1067a369de7bbb4d6223fadd00f7dd1ca2082f61a2ef21a091e69cdd
Contents?: true
Size: 434 Bytes
Versions: 140
Compression:
Stored size: 434 Bytes
Contents
require 'fiber' # Method from em-synchrony # https://github.com/igrigorik/em-synchrony # # A convenience method for wrapping EM.run body within # a Ruby Fiber such that async operations can be transparently # paused and resumed based on IO scheduling module EventMachine def self.fiber_run(blk=nil, tail=nil, &block) context = Proc.new{ Fiber.new{ (b = blk || block) and b.call }.resume } self.run(context, tail) end end
Version data entries
140 entries across 140 versions & 1 rubygems