DirectStreamAccess : DirectStreamAccess
Implementation for the SERVER side. Available as Meteor.directStream
singleton.
Kind: global class
Extends: DirectStreamAccessCommon
Category: SERVER
Sends a message to a specified Meteor session id.
Kind: instance method of DirectStreamAccess
Throws:
Error
When session id is not found.
Param | Type | Description |
---|---|---|
message | string |
Message to send to the client. |
sessionId | string |
Meteor's internal session id. |
Broadcasts the message to all clients.
Kind: instance method of DirectStreamAccess
Param | Type | Description |
---|---|---|
message | string |
Message to send to all connected clients. |
Registers a message handler, which will be called to process every incoming message on the socket.
Kind: instance method of DirectStreamAccess
Param | Type | Description |
---|---|---|
messageHandler | messageHandler |
Function to process the incoming messages. |
Prevents calling the original meteor message handler. Makes the message invisible for Meteor.
Since any message handler is bound to this class, inside the message handler it is just
called with this.preventCallingMeteorHandler()
.
Kind: instance method of DirectStreamAccess
Stops processing any other message handlers.
Since any message handler is bound to this class, inside the message handler it is just
called with this.stopProcessingHandlers()
.
Kind: instance method of DirectStreamAccess
Passes the received message to registered handlers.
Kind: instance method of DirectStreamAccess
Access: protected
Param | Type | Description |
---|---|---|
message | string |
Raw 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. |
Callback passed to the registerMessageHandler
that should process the incoming messages.
Kind: inner typedef of DirectStreamAccess
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. |