Class: Jaeger::UdpSender::Transport
- Inherits:
-
Object
- Object
- Jaeger::UdpSender::Transport
- Defined in:
- lib/jaeger/udp_sender/transport.rb
Constant Summary collapse
- FLAGS =
0
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(host, port, logger:) ⇒ Transport
constructor
A new instance of Transport.
- #open ⇒ Object
- #write(str) ⇒ Object
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
#close ⇒ Object
27 |
# File 'lib/jaeger/udp_sender/transport.rb', line 27 def close; end |
#flush ⇒ Object
20 21 22 23 |
# File 'lib/jaeger/udp_sender/transport.rb', line 20 def flush data = @buffer.read(@buffer.available) send_bytes(data) end |
#open ⇒ Object
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 |