Class: Jaeger::UdpSender::Transport

Inherits:
Object
  • Object
show all
Defined in:
lib/jaeger/udp_sender/transport.rb

Constant Summary collapse

FLAGS =
0

Instance Method Summary collapse

Constructor Details

#initialize(host, port, logger:) ⇒ Transport

Returns a new instance of Transport.



8
9
10
11
12
13
14
# File 'lib/jaeger/udp_sender/transport.rb', line 8

def initialize(host, port, logger:)
  @socket = UDPSocket.new
  @host = host
  @port = port
  @logger = logger
  @buffer = ::Thrift::MemoryBufferTransport.new
end

Instance Method Details

#closeObject



27
# File 'lib/jaeger/udp_sender/transport.rb', line 27

def close; end

#flushObject



20
21
22
23
# File 'lib/jaeger/udp_sender/transport.rb', line 20

def flush
  data = @buffer.read(@buffer.available)
  send_bytes(data)
end

#openObject



25
# File 'lib/jaeger/udp_sender/transport.rb', line 25

def open; end

#write(str) ⇒ Object



16
17
18
# File 'lib/jaeger/udp_sender/transport.rb', line 16

def write(str)
  @buffer.write(str)
end