Sha256: dd26ee00818f04173b120eb1b78590424a5b3aeafe188b15bff204f89000a1b0

Contents?: true

Size: 970 Bytes

Versions: 10

Compression:

Stored size: 970 Bytes

Contents

# Define RubySkynet::ServiceRegistry based on whether the ZooKeeper or Doozer gem is present
module RubySkynet
  begin
    require 'zookeeper'
    require 'zookeeper/client'
    require 'ruby_skynet/zookeeper/service_registry'
    # Monkey-patch so that the Zookeeper JRuby code can handle nil values in Zookeeper
    require 'ruby_skynet/zookeeper/extensions/java_base' if defined?(::JRUBY_VERSION)
    ServiceRegistry = RubySkynet::Zookeeper::ServiceRegistry
    CachedRegistry  = RubySkynet::Zookeeper::CachedRegistry
    Registry        = RubySkynet::Zookeeper::Registry
  rescue LoadError
    begin
      require 'ruby_doozer'
      require 'ruby_skynet/doozer/service_registry'
    rescue LoadError
      raise LoadError, "Must gem install either 'zookeeper' or 'ruby_doozer'. 'zookeeper' is recommended"
    end
    ServiceRegistry = RubySkynet::Doozer::ServiceRegistry
    CachedRegistry  = Doozer::CachedRegistry
    Registry        = Doozer::Registry
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby_skynet-1.2.7 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.2.6 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.2.5 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.2.4 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.2.3 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.2.2 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.2.1 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.2.0 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.1.1 lib/ruby_skynet/service_registry.rb
ruby_skynet-1.1.0 lib/ruby_skynet/service_registry.rb