class EMStatsd::TCPWrapper
Attributes
connection[R]
Public Class Methods
new(host, port)
click to toggle source
# File lib/em_statsd/tcp_wrapper.rb, line 6 def initialize(host, port) # eventmachine forces us to listen on a UDP socket even # though we only # want to send, so we'll just give it a junk address @connection = EM.connect(host, port, EM::Connection) end
Public Instance Methods
close()
click to toggle source
# File lib/em_statsd/tcp_wrapper.rb, line 13 def close connection.close_connection_after_writing end
flush()
click to toggle source
# File lib/em_statsd/tcp_wrapper.rb, line 17 def flush end
write(message)
click to toggle source
# File lib/em_statsd/tcp_wrapper.rb, line 21 def write(message) connection.send_data(message) end