Class: ZreMsg

ZreMsg(cmd, optionsopt)

ZreMsg represents a message in ZRE format.

Constructor

new ZreMsg(cmd, optionsopt)

Parameters:
Name Type Attributes Description
cmd number ZreMsg command as number
options object <optional>
Options object
Properties
Name Type Attributes Default Description
sequence number <optional>
1 Sequence of the message
group string <optional>
Group which the node/peer joins or leaves
content Buffer <optional>
Content of the message
endpoint string <optional>
TCP address of the node/peer
groups Array.<string> <optional>
Groups in which the node/peer participates
status number <optional>
Groups status of the node/peer
name string <optional>
Name of the node/peer
headers object <optional>
Headers of the node/peer
Source:

Methods

(static) read(buffer, frame) → {ZreMsg}

Reads, validates and creates a new ZreMsg from the given Buffer and frame.
Parameters:
Name Type Description
buffer Buffer Binary Buffer in ZreMsg format
frame Buffer Message content as binary Buffer
Source:
Returns:
Type
ZreMsg

send(socket) → {Promise}

Sends this ZreMsg with the given zeromq dealer socket.
Parameters:
Name Type Description
socket zeromq.Socket Zeromq dealer socket
Source:
Returns:
Type
Promise

toBuffer() → {Buffer}

Creates a binary Buffer from this ZreMsg.
Source:
Returns:
Binary Buffer in ZreMsg format
Type
Buffer