Create a new InternalSessionImpl instance
the factory for generating conversation sets
the service registry
a factory for creating the connection
the session options
The number of reconnection attempts
The connection to the server
The current conversation set
The factory for generating conversation sets
The emitter to emit stream events on
The finite state machine that keeps track of the internal state
The session options
The session principal
The server's maximum message size
The service adapter
The service locator
The service registry
The session activity monitor
The session activity monitor factory
The session ID
The session locks held by this session
The session token
The topic cache
The router that routes incoming messages
The registry for streams on topic values
The transports that are available for this session
The version of this client library in the form major.minor.patch
Cancel a reconnect event
the reason for closing
Check if the session is connected
If the session is not connected an error will be emitted on the session's stream
true if the finite state machine is in the connected state
Manually close the session
Attempt to connect to the server
Return the sesssion context
Get the conversation set
a reference to the conversation set
Get the error handler
a handler that logs the error in the error logs
Get the session's options
the options
Get the session principal
the session principal
Get the topic router
the topic router
Get the server's maximum message size.
Get the service adapter
the service adapter
Get the service locator
the service locator
Get the service registry
a reference to the service registry
Get the session ID
the session ID
Get the current state
the state of the finite state machine
Get the stream registry
the stream registry
Close the session
This will close all topic streams, discard all conversations and emit a
close event on the session's stream
the reason for closing the session. This will be passed on to
the stream close event.
Query if the session is connected
true if the finite state machine is in the connected state
Query if the session is using a shared session
Request a session lock
the lock name
the lock scope
a Promise that resolves with the acquired session lock
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() { ... }
});
It is possible to bind multiple listeners to the same event. In this case, the listeners will be called in the order they were bound.
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.
Add a callback that will be called when the session state changes
the function to call when the session state changes
System ping handler
Forwards the call to the activity monitor
Attempt to reconnect after disconnecting
the session options
the token of the session when it was connected
Replace the conversation set with a new one.
the error that caused the message loss
Set the principal of the session
the new principal
Unlock a session lock by acquisision
the session lock acquisition
a Promise that completes when the lock is released
Updates the session with missing features that may have been loaded asynchronously. This method only has an effect when running the client as a modular client in the browser.
Copyright © 2025 DiffusionData Ltd. All Rights Reserved.
Internal session implementation