Sha256: 15605ceb936d235f2bd22433ef11e6fc2b374a0293f13bc6567e8f91e81a992d

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 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'

      # Shortcuts to loaded Registry classes
      ServiceRegistry = RubySkynet::Doozer::ServiceRegistry
      CachedRegistry  = Doozer::CachedRegistry
      Registry        = Doozer::Registry
    rescue LoadError
      require 'ruby_skynet/static_service_registry'

      # Use Static Service Registry
      ServiceRegistry = RubySkynet::StaticServiceRegistry
    end

  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 lib/ruby_skynet.rb