Sha256: c9491e23df5fa91c2d9d466835357996e0ce637f68e7388a5b176b0be9ecbf4d

Contents?: true

Size: 1.49 KB

Versions: 28

Compression:

Stored size: 1.49 KB

Contents

# encoding: utf-8

class ZMQ::Socket::Req

# == 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

  TYPE_STR = "REQ"

  def type
    ZMQ::REQ
  end

  unsupported_api :sendm
  handle_fsm_errors "REQ sockets allows only an alternating sequence of send and receive calls.", :send, :send_frame, :send_message, :recv, :recv_nonblock, :recv_frame, :recv_frame_nonblock, :recv_message

  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
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rbczmq-1.7.9 lib/zmq/socket/req.rb
rbczmq-1.7.8 lib/zmq/socket/req.rb
rbczmq-1.7.7 lib/zmq/socket/req.rb
rbczmq-1.7.6 lib/zmq/socket/req.rb
rbczmq-1.7.5 lib/zmq/socket/req.rb
rbczmq-1.7.4 lib/zmq/socket/req.rb
rbczmq-1.7.3 lib/zmq/socket/req.rb
rbczmq-1.7.2 lib/zmq/socket/req.rb
rbczmq-1.7.1 lib/zmq/socket/req.rb
rbczmq-1.7.0 lib/zmq/socket/req.rb
rbczmq-1.6.4 lib/zmq/socket/req.rb
rbczmq-1.6.2 lib/zmq/socket/req.rb
rbczmq-1.6 lib/zmq/socket/req.rb
rbczmq-1.5 lib/zmq/socket/req.rb
rbczmq-1.4 lib/zmq/socket/req.rb
rbczmq-1.3 lib/zmq/socket/req.rb
rbczmq-1.2 lib/zmq/socket/req.rb
rbczmq-1.1 lib/zmq/socket/req.rb
rbczmq-1.0 lib/zmq/socket/req.rb
rbczmq-0.9 lib/zmq/socket/req.rb