Class: Waterfall::Client::ClientWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/waterfall/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ClientWrapper

Returns a new instance of ClientWrapper.



24
25
26
27
28
29
# File 'lib/waterfall/client.rb', line 24

def initialize(options)
  @transport = ::Thrift::FramedTransport.new(::Thrift::Socket.new(options[:host], options[:port]))
  protocol = ::Thrift::BinaryProtocol.new(@transport)
  @client = Thrift::WaterfallService::Client.new(protocol)
  @transport.open
end

Instance Method Details

#closeObject



35
36
37
# File 'lib/waterfall/client.rb', line 35

def close
  @transport.close
end

#next_idObject



31
32
33
# File 'lib/waterfall/client.rb', line 31

def next_id
  @client.nextId
end