Sha256: 2fe6bd3b60020282e97434698418cc6db969b921c4ef88834d29bbc545f27435

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

require 'semantic_logger'
require 'ruby_skynet/exceptions'
require 'ruby_skynet/version'
require 'ruby_skynet/ruby_skynet'

module RubySkynet
  autoload :Common,          'ruby_skynet/common'
  autoload :Connection,      'ruby_skynet/connection'
  autoload :Client,          'ruby_skynet/client'
  autoload :Service,         'ruby_skynet/service'
  autoload :Server,          'ruby_skynet/server'
  autoload :Zookeeper,       'ruby_skynet/zookeeper'
end

# Autodetect if Zookeeper gem is loaded, otherwise look for Doozer
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)

    # Shortcuts to loaded Registry classes
    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, "Load either the 'zookeeper' or 'ruby_doozer' gem prior to loading RubySkynet. 'zookeeper' is preferred"
    end

    # Shortcuts to loaded Registry classes
    ServiceRegistry = RubySkynet::Doozer::ServiceRegistry
    CachedRegistry  = Doozer::CachedRegistry
    Registry        = Doozer::Registry
  end
end

if defined?(Rails)
  require 'ruby_skynet/railtie'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_skynet-2.0.0.rc1 lib/ruby_skynet.rb