Class: Pantry::Communication::SendSocket

Inherits:
WritingSocket show all
Defined in:
lib/pantry/communication/send_socket.rb

Overview

The SendSocket allows one-way asynchronous communication to the server. This is implemented through the ZMQ DEALER socket, which communicates with the Server’s ROUTER socket.

Instance Attribute Summary

Attributes inherited from WritingSocket

#host, #port

Instance Method Summary collapse

Methods inherited from WritingSocket

#close, #initialize, #open, #send_message

Constructor Details

This class inherits a constructor from Pantry::Communication::WritingSocket

Instance Method Details

#build_socketObject



9
10
11
# File 'lib/pantry/communication/send_socket.rb', line 9

def build_socket
  Celluloid::ZMQ::DealerSocket.new
end

#open_socket(socket) ⇒ Object



13
14
15
# File 'lib/pantry/communication/send_socket.rb', line 13

def open_socket(socket)
  socket.connect("tcp://#{host}:#{port}")
end