DynamicMessagesProtocol : DynamicMessagesProtocol
Implementation of common logic for dynamic messages type protocols.
Kind: global abstract class
Extends: CustomProtocol
Category: PROTOCOLS
Param | Type | Description |
---|---|---|
name | string |
Class name of the protocol. |
Fires callbacks registered for a concrete type of message. The type of message is checked in
the message itself by checking the field with name specified with this.setTypeFieldName
.
Kind: instance method of DynamicMessagesProtocol
Param | Type | Description |
---|---|---|
message | Object |
Decoded message object. |
sessionId | string |
Session id of sender. |
[userId] | string |
User id if available. |
[connectionId] | Symbol |
Id of the additional DDP connection. |
[connection] | Object |
Reference to DDP connection object. |
Registers a callback for a specified message type.
Kind: instance method of DynamicMessagesProtocol
Param | Type | Description |
---|---|---|
messageType | string |
Message type. |
callback | messageHandler |
Callback to fire. |
Removes a callback for a specified message type.
Kind: instance method of DynamicMessagesProtocol
Param | Type | Description |
---|---|---|
messageType | string |
Message type. |
callback | messageHandler |
Callback to remove. |
Removes all callbacks for a specified message type.
Kind: instance method of DynamicMessagesProtocol
Param | Type | Description |
---|---|---|
messageType | string |
Message type. |
Sends the specified message type with payload.
Kind: instance method of DynamicMessagesProtocol
Param | Type | Default | Description |
---|---|---|---|
messageType | string |
Message type. | |
payload | Object |
Object with the data. | |
target | Array | string | Object |
Server: session id or an array of it, client: ddp connection instance. | |
deferred | boolean |
false |
Specifies whether to defer the sending in the loop. |
Kind: inner typedef of DynamicMessagesProtocol
Param | Type | Description |
---|---|---|
message | string |
Message received on the socket. |
[sessionId] | string |
Meteor's internal session id. |
[userId] | string |
User id if available. |
[connectionId] | Symbol |
Id of the additional DDP connection. |
[connection] | Object |
Reference to DDP connection object. |