Methods
(async, static) addContextListener(handler, contextType) → {Promise.<Unsubscribe>}
Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler, it will receive all of its declared contexts.
Parameters:
Name | Type | Description |
---|---|---|
handler |
ContextHandler | Handler for incoming context. |
contextType |
string | The type of context you wish to handle. |
- Tutorials:
Returns:
- Type
- Promise.<Unsubscribe>
(async, static) broadcast(context) → {Promise.<void>}
Broadcasts a context for the channel of the current entity.
Parameters:
Name | Type | Description |
---|---|---|
context |
Context | New context to set. |
- Tutorials:
Returns:
- Type
- Promise.<void>
(async, static) getSystemChannels() → {Promise.<Array.<ContextGroupInfo>>}
Returns the Interop-Broker-defined context groups available for an entity to join.
- Tutorials:
Returns:
- Type
- Promise.<Array.<ContextGroupInfo>>
(async, static) joinChannel(contextGroupId, targetopt) → {Promise.<void>}
Join all Interop Clients at the given identity to context group contextGroupId
.
If no target is specified, it adds the sender to the context group.
Because multiple Channel connections/Interop Clients can potentially exist at a uuid
/name
combo, we currently join all Channel connections/Interop Clients at the given identity to the context group.
If an endpointId
is provided (which is unlikely, unless the call is coming from an external adapter), then we only join that single connection to the context group.
For all intents and purposes, there will only be 1 connection present in Platform and Browser implementations, so this point is more-or-less moot.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
contextGroupId |
string | Id of the context group. |
|
target |
Identity |
<optional> |
Identity of the entity you wish to join to a context group. |
- Tutorials:
Returns:
- Type
- Promise.<void>
(async, static) leaveCurrentChannel(targetopt) → {Promise.<void>}
Removes the specified target from a context group. If no target is specified, it removes the sender from their context group.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
target |
Identity |
<optional> |
Identity of the entity you wish to join to a context group. |
- Tutorials:
Returns:
- Type
- Promise.<void>