Sha256: ddc6262c3dd36934a07c30ccce4e6b365f1812e0c55531798bfb04b445ccf6bd

Contents?: true

Size: 1.47 KB

Versions: 28

Compression:

Stored size: 1.47 KB

Contents

# encoding: utf-8

class ZMQ::Socket::Rep

# == ZMQ::Socket::Rep
#
# A socket of type ZMQ::Socket::Rep is used by a service to receive requests from and send replies to a client. This socket type
# allows only an alternating sequence of ZMQ::Socket#recv and subsequent ZMQ::Socket#send calls. Each request received is
# fair-queued from among all clients, and each reply sent is routed to the client that issued the last request. If the
# original requester doesn't exist any more the reply is silently discarded.
#
# When a ZMQ::Socket::Rep socket enters an exceptional state due to having reached the high water mark for a client, then any replies
# sent to the client in question shall be dropped until the exceptional state ends.
#
# === Summary of ZMQ::Socket#rep characteristics
#
# [Compatible peer sockets] ZMQ::Socket::Rep
# [Direction] Bidirectional
# [Send/receive pattern] Receive, Send, Receive, Send, …
# [Incoming routing strategy] Fair-queued
# [Outgoing routing strategy] Last peer
# [ZMQ::Socket#hwm option action] Drop

  TYPE_STR = "REP"

  def type
    ZMQ::REP
  end

  unsupported_api :sendm
  handle_fsm_errors "REP sockets allows only an alternating sequence of receive and subsequent send 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 REP 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/rep.rb
rbczmq-1.7.8 lib/zmq/socket/rep.rb
rbczmq-1.7.7 lib/zmq/socket/rep.rb
rbczmq-1.7.6 lib/zmq/socket/rep.rb
rbczmq-1.7.5 lib/zmq/socket/rep.rb
rbczmq-1.7.4 lib/zmq/socket/rep.rb
rbczmq-1.7.3 lib/zmq/socket/rep.rb
rbczmq-1.7.2 lib/zmq/socket/rep.rb
rbczmq-1.7.1 lib/zmq/socket/rep.rb
rbczmq-1.7.0 lib/zmq/socket/rep.rb
rbczmq-1.6.4 lib/zmq/socket/rep.rb
rbczmq-1.6.2 lib/zmq/socket/rep.rb
rbczmq-1.6 lib/zmq/socket/rep.rb
rbczmq-1.5 lib/zmq/socket/rep.rb
rbczmq-1.4 lib/zmq/socket/rep.rb
rbczmq-1.3 lib/zmq/socket/rep.rb
rbczmq-1.2 lib/zmq/socket/rep.rb
rbczmq-1.1 lib/zmq/socket/rep.rb
rbczmq-1.0 lib/zmq/socket/rep.rb
rbczmq-0.9 lib/zmq/socket/rep.rb