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

Version Path
protobuf-2.8.13 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.12 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.11 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.10 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.9 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.8 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.7 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.6 lib/protobuf/ext/eventmachine.rb
protobuf-2.7.12 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.5 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.4 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.3 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.2 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.1 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.0 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.0.beta9-java lib/protobuf/ext/eventmachine.rb
protobuf-2.8.0.beta9 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.0.beta8-java lib/protobuf/ext/eventmachine.rb
protobuf-2.8.0.beta8 lib/protobuf/ext/eventmachine.rb
protobuf-2.8.0.beta6-java lib/protobuf/ext/eventmachine.rb