Sha256: 08bf8f5f8f320ea5047ee2653705d5872dadceb208a212dcfb407395e0e57ac4

Contents?: true

Size: 970 Bytes

Versions: 39

Compression:

Stored size: 970 Bytes

Contents

# Fibers are hard... let's go shopping!
begin
  require 'fiber'
rescue LoadError => ex
  if defined? JRUBY_VERSION
    if RUBY_VERSION < "1.9.2"
      raise LoadError, "Celluloid requires JRuby 1.9 mode. Please pass the --1.9 flag or set JRUBY_OPTS=--1.9"
    end

    # Fibers are broken on JRuby 1.6.5. This works around the issue
    if JRUBY_VERSION[/^1\.6\.5/]
      require 'jruby'
      org.jruby.ext.fiber.FiberExtLibrary.new.load(JRuby.runtime, false)
      class org::jruby::ext::fiber::ThreadFiber
        field_accessor :state
      end

      class Fiber
        def alive?
          JRuby.reference(self).state != org.jruby.ext.fiber.ThreadFiberState::FINISHED
        end
      end
    else
      # Just in case subsequent JRuby releases have broken fibers :/
      raise ex
    end
  elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
    raise LoadError, "Celluloid requires Rubinius 1.9 mode. Please pass the -X19 flag."
  else
    raise ex
  end
end

Version data entries

39 entries across 37 versions & 7 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/celluloid-0.16.0/lib/celluloid/fiber.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/celluloid-0.16.0/lib/celluloid/fiber.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/celluloid-0.16.0/lib/celluloid/fiber.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/celluloid-0.16.0/lib/celluloid/fiber.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/celluloid-0.16.0/lib/celluloid/fiber.rb
celluloid-0.16.0 lib/celluloid/fiber.rb
celluloid-0.16.0.pre3 lib/celluloid/fiber.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/celluloid-0.15.2/lib/celluloid/fiber.rb
celluloid-0.16.0.pre2 lib/celluloid/fiber.rb
celluloid-0.16.0.pre lib/celluloid/fiber.rb
celluloid-0.15.2 lib/celluloid/fiber.rb
celluloid-0.15.1 lib/celluloid/fiber.rb
celluloid-0.15.0 lib/celluloid/fiber.rb
celluloid-0.15.0.pre2 lib/celluloid/fiber.rb
celluloid-0.15.0.pre lib/celluloid/fiber.rb
celluloid-0.14.1 lib/celluloid/fiber.rb
celluloid-0.14.1.pre lib/celluloid/fiber.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/celluloid-0.14.0/lib/celluloid/fiber.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/celluloid-0.14.0/lib/celluloid/fiber.rb
celluloid-0.14.0 lib/celluloid/fiber.rb