Constructor
new Messenger(optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
Methods
(static) JsonRpcDeserializer(rawMessage, callback)
Parameters:
Name | Type | Description |
---|---|---|
rawMessage | buffer | Incoming message as buffer |
callback | function | Transform stream callback(err, data) |
- Source
(static) JsonRpcSerializer(data, sender, receiver, callback)
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
data | array | Object to transform Properties
| ||||||
sender | Bucket~contact | Origin peer for message | ||||||
receiver | Bucket~contact | Destination peer for message | ||||||
callback | function | Transform stream callback(err, data) |
- Source
(inner) deserializer(data, encoding, callback)
Parameters:
Name | Type | Description |
---|---|---|
data | object | | Incoming message buffer or parsed JSON data |
encoding | string | | Encoding of incoming data |
callback | Messenger~deserializerCallback |
- Source
(inner) serializer(data, encoding, callback)
Parameters:
Name | Type | Description |
---|---|---|
data | object | | Outgoing message buffer or parsed JSON data |
encoding | string | | Encoding of incoming data |
callback | Messenger~serializerCallback |
- Source
Type Definitions
deserializerCallback(error, data)
Parameters:
Name | Type | Description |
---|---|---|
error | error | | |
data | buffer | | Deserialized data to pass through middleware |
- Source
serializerCallback(error, data)
Parameters:
Name | Type | Description |
---|---|---|
error | error | | |
data | buffer | | Serialized data to pass through middleware |
- Source