Close the stream. This will emit a 'close' event to any assigned listeners. No further events will be emitted.
Remove a listener from a specified event.
Example:
// Bind a single listener to the 'foo' event and then deregister it
var listener = function() {};
stream.on('foo', listener);
stream.off('foo', listener);
Example:
// Bind a listener to the 'foo' event and deregister all listeners
var listener = function() {};
stream.on('foo', listener);
stream.off('foo');
the listener to remove. All listeners for the event are removed if this is not specified. This argument is ignored if the first argument is a CallbackMap.
this stream.
Register listeners against events.
A single listener may be bound to an event by passing the event name and listener function.
Multiple listeners may be bound by passing in a CallbackMap, mapping event names to listener functions.
Example:
// Bind a single listener to the 'foo' event
stream.on('foo', function(arg1, arg2) {
console.log("Called for 'foo' event", arg1, arg2);
});
Example:
// Bind multiple listeners
stream.on({
foo : function() { ... },
bar : function() { ... },
baz : function() { ... }
});
the event name or CallbackMap mapping event names to listeners
the listener to bind to the event, if passed as string. This argument is ignored if the first argument is a CallbackMap.
this stream.
A stream of messages sent to this session for a particular path.
Events
message
Emitted when a message is received
Parameters:
message
: Message - the incoming messageclose
Emitted when the stream is closed
error
Emitted when an error occurred
Parameters:
error
: any - the errorsince 6.2 < One-way messaging is deprecated in favor of request-response messaging. See sendRequest and sendRequestToFilter. This interface will be removed in a future release.