Class: SharedDataBusClient
Defined in: src/sdk/data/SharedDataBus.ts:101
Experimental
A provider of data that is stored in a global object shared between CoherentGT views. The client requires a corresponding SharedDataBusHost to function properly. This API is still under development and should not be used for production code.
Extended by
Implements
Constructors
Constructor
new SharedDataBusClient(
sharedGlobalName):SharedDataBusClient
Defined in: src/sdk/data/SharedDataBus.ts:120
Experimental
Creates an instance of SharedDataBusClient.
Parameters
| Parameter | Type | Description |
|---|---|---|
sharedGlobalName | string | The name of the shared global object that is used to hold the data provided by the client. This API is still under development and should not be used for production code. |
Returns
SharedDataBusClient
Properties
_isAlive
protectedreadonly_isAlive:Subject<boolean>
Defined in: src/sdk/data/SharedDataBus.ts:106
Experimental
data
protecteddata:Map<string,LabelEntry<any>>
Defined in: src/sdk/data/SharedDataBus.ts:103
Experimental
isAlive
readonlyisAlive:Subscribable<boolean>
Defined in: src/sdk/data/SharedDataBus.ts:111
Experimental
Signals if the data bus host is alive and available for writing and reading. This API is still under development and should not be used for production code.
localSubjects
protectedreadonlylocalSubjects:Map<string,Map<number,DistributedSubject<any>>>
Defined in: src/sdk/data/SharedDataBus.ts:104
Experimental
sharedGlobalName
protectedreadonlysharedGlobalName:string
Defined in: src/sdk/data/SharedDataBus.ts:120
Experimental
The name of the shared global object that is used to hold the data provided by the client. This API is still under development and should not be used for production code.
typedImplementation
protectedreadonlytypedImplementation:TypedDataBusClient<Record<string,any>,number>
Defined in: src/sdk/data/SharedDataBus.ts:113
Experimental
Methods
createTypedImplementation()
protectedcreateTypedImplementation():TypedDataBusClient<Record<string,any>>
Defined in: src/sdk/data/SharedDataBus.ts:186
Experimental
Creates an object that can access any data item from this client and implements TypedDataBusClient.
Returns
TypedDataBusClient<Record<string, any>>
An object that can access any data item from this client and implements TypedDataBusClient.
getDataItemEntry()
protectedgetDataItemEntry<R,L>(label,index):DataItemEntry<R[L]>
Defined in: src/sdk/data/SharedDataBus.ts:252
Experimental
Gets the entry for a data item from the shared storage.
Type Parameters
| Type Parameter | Description |
|---|---|
R extends Record<string, any> | A record describing the data item entry to get. The record should contain a property whose name is equal to the label of the data item entry, and the type of the property defines the value type of the data item entry. |
L extends string | The label of the data item entry to get. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label of the data item entry to get. |
index | number | The index of the data item entry to get. |
Returns
DataItemEntry<R[L]>
The requested data item entry.
getDataItemEntryFromLabelEntry()
protectedgetDataItemEntryFromLabelEntry<T>(labelEntry,index):DataItemEntry<T>
Defined in: src/sdk/data/SharedDataBus.ts:227
Experimental
Gets the entry for a data item from a label entry.
Type Parameters
| Type Parameter | Description |
|---|---|
T | The type of the data item's value. |
Parameters
| Parameter | Type | Description |
|---|---|---|
labelEntry | LabelEntry<T> | The label entry from which to get the data item entry. |
index | number | The index of the data item entry to get. |
Returns
DataItemEntry<T>
The requested data item entry.
getLabelEntry()
protectedgetLabelEntry<R,L>(label):LabelEntry<R[L]>
Defined in: src/sdk/data/SharedDataBus.ts:207
Experimental
Gets the entry for a data item label from the shared storage.
Type Parameters
| Type Parameter | Description |
|---|---|
R extends Record<string, any> | A record describing the data item label entry to get. The record should contain a property whose name is equal to the label, and the type of the property defines the value type of the label's data items. |
L extends string | The label for which to get an entry. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label for which to get an entry. |
Returns
LabelEntry<R[L]>
The requested data item label entry.
getLocalSubject()
protectedgetLocalSubject<R,L>(label,index):DistributedSubject<R[L]>
Defined in: src/sdk/data/SharedDataBus.ts:267
Experimental
Gets the local subject for a data item. If a local subject does not exist for the specified data item, then one will be created.
Type Parameters
| Type Parameter | Description |
|---|---|
R extends Record<string, any> | A record describing the data item for which to get a local subject. The record should contain a property whose name is equal to the label of the data item, and the type of the property defines the value type of the data item. |
L extends string | The label of the data item for which to get a local subject. |
Parameters
| Parameter | Type | Description |
|---|---|---|
label | L | The label of the data item for which to get a local subject. |
index | number | The index of the data item for which to get a local subject. |
Returns
DistributedSubject<R[L]>
The local subject for the specified data item.
initSharedGlobal()
protectedinitSharedGlobal():Promise<void>
Defined in: src/sdk/data/SharedDataBus.ts:147
Experimental
Initializes this client from its associated shared global object.
Returns
Promise<void>
of()
of<
R>():TypedDataBusClient<R>
Defined in: src/sdk/data/SharedDataBus.ts:195
Retrieves a typed data bus client that provides data items described by a record type.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
R extends Record<string, any> | Record<never, never> | A record describing the data items available from the typed client to return. The name of each property in the record defines one label that can be used to retrieve a data item, and the type of the property defines the value type of data items retrieved using the label (under any index). |
Returns
A typed data bus client that provides data items described by the specified record type.
Implementation of
setSharedData()
protectedsetSharedData(data):void
Defined in: src/sdk/data/SharedDataBus.ts:172
Experimental
Sets the shared data object used by this client.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | Map<string, LabelEntry<any>> | The shared data object to set. |
Returns
void
update()
update():
void
Defined in: src/sdk/data/SharedDataBus.ts:289
Experimental
Updates the data bus to notify subscribers of updated data items. This API is still under development and should not be used for production code.
Returns
void