Parent

Methods

Files

ZMQ::Socket::Req

Constants

TYPE_STR

ZMQ::Socket::Req

A socket of type ZMQ::Socket::Req is used by a client to send requests to and receive replies from a service. This socket type allows only an alternating sequence of ZMQ::Socket#send and subsequent ZMQ::Socket#recv calls. Each request sent is load-balanced among all services, and each reply received is matched with the last issued request.

When a ZMQ::Socket::Req socket enters an exceptional state due to having reached the high water mark for all services, or if there are no services at all, then any ZMQ::Socket#send operations on the socket shall block until the exceptional state ends or at least one service becomes available for sending; messages are not discarded.

Summary of ZMQ::Socket::Req characteristics

Compatible peer sockets

ZMQ::Socket::Rep

Direction

Bidirectional

Send/receive pattern

Send, Receive, Send, Receive, …

Outgoing routing strategy

Load-balanced

Incoming routing strategy

Last peer

ZMQ::Socket#hwm option action

Block

Public Instance Methods

send_frame(frame, flags = 0) click to toggle source
# File lib/zmq/socket/req.rb, line 32
def send_frame(frame, flags = 0)
  raise ZMQ::Error, "cannot send multiple frames on REQ sockets" if (flags & ZMQ::Frame::MORE) == ZMQ::Frame::MORE
  super
end
type() click to toggle source
# File lib/zmq/socket/req.rb, line 25
def type
  ZMQ::REQ
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.