DirectStreamAccess : DirectStreamAccess
Implementation for the CLIENT side. Available as Meteor.directStream
singleton.
Kind: global class
Extends: DirectStreamAccessCommon
Category: CLIENT
- DirectStreamAccess :
DirectStreamAccess
- instance
- inner
- ~messageHandler :
function
- ~messageHandler :
Sends a message to the server. This method does not throw any error if there is no connection to server. If you care about this check the status with Meteor.status() before sending anything. You can pass an additional custom DDP connection in order to use that one instead the default one.
Kind: instance method of DirectStreamAccess
Param | Type | Description |
---|---|---|
message | string |
Message to send to the server. |
connection | Object |
DDP connection instance or connection id. |
Register a custom connection from DDP.connect
.
Kind: instance method of DirectStreamAccess
Returns: Symbol
- Id of the additional DDP connection.
Param | Type | Description |
---|---|---|
[connection] | Object |
Reference to DDP connection object. |
Returns the id of the main DDP connection.
Kind: instance method of DirectStreamAccess
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. |