Class: Droonga::Client::Connection::DroongaProtocol::Coolio::Sender

Inherits:
Coolio::TCPSocket
  • Object
show all
Defined in:
lib/droonga/client/connection/droonga-protocol/coolio.rb

Instance Method Summary collapse

Constructor Details

#initialize(socket) ⇒ Sender

Returns a new instance of Sender.



50
51
52
# File 'lib/droonga/client/connection/droonga-protocol/coolio.rb', line 50

def initialize(socket)
  super(socket)
end

Instance Method Details

#send(tag, data) ⇒ Object



54
55
56
57
58
# File 'lib/droonga/client/connection/droonga-protocol/coolio.rb', line 54

def send(tag, data)
  fluent_message = [tag, Time.now.to_i, data]
  packed_fluent_message = MessagePackPacker.pack(fluent_message)
  write(packed_fluent_message)
end