SessionManager

SessionManager

An object used for session manipulation.

Mixes in EventEmitter for event listening.

Methods

getDescriptors() → {Promise}

See:

Retrieve session descriptors that can be used to create sessions.

Returns:

Promise that resolves to an array of SessionDescriptor objects.

Type
Promise

getSessions() → {Array.<Session>}

An array of session instances that have been created by the current user.

Returns:
Type
Array.<Session>

createSession(descriptor, optionsopt) → {Promise}

See:

Create a new session instance

Parameters:
Name Type Attributes Description
descriptor SessionDescriptor

Uniquely identifies the configuration used to create the session.

options Object <optional>

Session settings that are applied to the created session

Properties
Name Type Attributes Description
hostName String <optional>

host name or IP address

port Number <optional>

host port number

Fires:
Returns:

Promise that resolves with Session upon successful creation.

Type
Promise

destroySession(session)

Stop and remove a currently running session instance.

Parameters:
Name Type Description
session Session
Fires:

Events

Event.SESSION_CREATED

Fired when a new session is created.

Parameters:
Type Description
Session

the session that was created

Event.SESSION_DESTROYED

Fired when a session is closed.

Parameters:
Type Description
String

id of destroyed session

Event.ERROR

Fired when there's an error with session creation or destruction.

Parameters:
Type Description
Error

the error