Class: NNQ::PUB0

Inherits:
Socket show all
Defined in:
lib/nnq/pub_sub.rb

Overview

PUB side of the pub/sub pattern (nng pub0). Broadcasts every message to every connected SUB. Per-peer bounded send queues —a slow peer drops messages instead of blocking fast peers. Defaults to listening.

Instance Attribute Summary

Attributes inherited from Socket

#options

Instance Method Summary collapse

Methods inherited from Socket

#all_peers_gone, bind, #bind, #close, #close_read, connect, #connect, #connection_count, #frozen_binary, #initialize, #last_endpoint, #monitor, #peer_connected, #raw?, #reconnect_enabled, #reconnect_enabled=

Constructor Details

This class inherits a constructor from NNQ::Socket

Instance Method Details

#send(body) ⇒ Object



14
15
16
17
# File 'lib/nnq/pub_sub.rb', line 14

def send(body)
  body = frozen_binary(body)
  Reactor.run { @engine.routing.send(body) }
end