Class: Haplocheirus::Service

Inherits:
ThriftClient
  • Object
show all
Defined in:
lib/haplocheirus/service.rb

Defined Under Namespace

Classes: ServiceDisabled

Constant Summary collapse

DEFAULTS =
{
  :transport_wrapper => Thrift::FramedTransport,
  :exception_classes => [ IOError,
                          Thrift::TransportException,
                          Thrift::ProtocolException,
                          Thrift::ApplicationException ]
}

Instance Method Summary collapse

Constructor Details

#initialize(servers = nil, options = {}) ⇒ Service

Returns a new instance of Service.

Raises:



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/haplocheirus/service.rb', line 12

def initialize(servers = nil, options = {})
  raise ServiceDisabled if options.key?(:enabled) && !options[:enabled]

  if servers.nil? || servers.empty?
    servers = ['127.0.0.1:7666']
  else
    server = Array(servers)
  end

  super(Haplocheirus::TimelineStore::Client, servers, DEFAULTS.merge(options))
end