Module: Cadence::Client

Defined in:
lib/cadence/client.rb,
lib/cadence/client/errors.rb,
lib/cadence/client/thrift_client.rb

Defined Under Namespace

Classes: ArgumentError, Error, ThriftClient

Constant Summary collapse

CLIENT_TYPES_MAP =
{
  thrift: Cadence::Client::ThriftClient
}.freeze

Class Method Summary collapse

Class Method Details

.generate(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cadence/client.rb', line 9

def self.generate(options = {})
  client_class = CLIENT_TYPES_MAP[Cadence.configuration.client_type]
  host = Cadence.configuration.host
  port = Cadence.configuration.port

  hostname = `hostname`
  thread_id = Thread.current.object_id
  identity = "#{thread_id}@#{hostname}"

  client_class.new(host, port, identity, options)
end