Create Nanonext Publisher Socket
create_pub_socket.RdCreates a nanonext publisher socket for broadcasting grid state updates to all worker processes.
Details
The publisher socket uses TCP on localhost to broadcast grid updates. Workers subscribe to this socket to receive notifications when pixels are added to the black set (walker termination events).
Communication pattern:
Main process publishes updates via this socket
Worker processes subscribe (see
worker_init())Non-blocking: workers poll for updates between steps
The socket binds to tcp://127.0.0.1:<port> and allows multiple
subscribers to connect.
Examples
if (FALSE) { # \dontrun{
# Create publisher socket
pub_socket <- create_pub_socket(port = 5555)
# Broadcast an update
broadcast_update(pub_socket, position = c(10, 15), version = 42)
# Clean up
nanonext::close(pub_socket)
} # }