Class: ZMQ::Socket::Pub

Inherits:
ZMQ::Socket show all
Includes:
UpstreamSocket
Defined in:
lib/zmq/socket/pub.rb,
ext/rbczmq/socket.c

Constant Summary collapse

TYPE_STR =

ZMQ::Socket::Pub

A socket of type ZMQ::Socket::Pub is used by a publisher to distribute data. Messages sent are distributed in a fan out fashion to all connected peers. The ZMQ::Socket#recv function is not implemented for this socket type.

When a ZMQ::Socket::Pub socket enters an exceptional state due to having reached the high water mark for a subscriber, then any messages that would be sent to the subscriber in question shall instead be dropped until the exceptional state ends. The ZMQ::Socket#send function shall never block for this socket type.

Summary of ZMQ::Socket::Pub characteristics

Compatible peer sockets

ZMQ::Socket::Sub

Direction

Unidirectional

Send/receive pattern

Send only

Incoming routing strategy

N/A

Outgoing routing strategy

Fan out

ZMQ::Socket#hwm option action

Drop

"PUB"

Constants inherited from ZMQ::Socket

BOUND, CONNECTED, PENDING, PROTO_REXP

Instance Method Summary collapse

Methods included from UpstreamSocket

included, #poll_readable?

Methods inherited from ZMQ::Socket

#affinity, #affinity=, #backlog, #backlog=, #bind, #close, #connect, #connect_all, #endpoint, #endpoints, #events, #fd, handle_fsm_errors, #hwm, #hwm=, #identity=, #linger, #linger=, #mcast_loop=, #mcast_loop?, #monitor, #poll_readable?, #poll_writable?, #rate, #rate=, #raw=, #rcvbuf, #rcvbuf=, #rcvhwm, #rcvhwm=, #rcvmore?, #rcvtimeo, #rcvtimeo=, #readable?, #real_bind, #real_connect, #reconnect_ivl, #reconnect_ivl=, #reconnect_ivl_max, #reconnect_ivl_max=, #recovery_ivl, #recovery_ivl=, #recovery_ivl_msec, #recovery_ivl_msec=, #recv, #recv_frame, #recv_frame_nonblock, #recv_message, #recv_nonblock, #send, #send_frame, #send_message, #sendm, #sndbuf, #sndbuf=, #sndhwm, #sndhwm=, #sndtimeo, #sndtimeo=, #state, #subscribe, #swap, #swap=, #to_s, #type_str, #unsubscribe, unsupported_api, #verbose=, #writable?

Instance Method Details

#typeObject


25
26
27
# File 'lib/zmq/socket/pub.rb', line 25

def type
  ZMQ::PUB
end