Class: SharedDataBusHost
Defined in: src/sdk/data/SharedDataBus.ts:321
Experimental
A host of data that is stored in a global object shared between CoherentGT views. Data published to the host can be retrieved by instances of SharedDataBusClient on the same or different CoherentGT views. The host also acts as a client for its own data. This API is still under development and should not be used for production code.
Extends
Implements
SharedDataBusHost
Constructors
Constructor
new SharedDataBusHost(
sharedGlobalName):SharedDataBusHost
Defined in: src/sdk/data/SharedDataBus.ts:329
Experimental
Creates an instance of SharedDataBusHost.
Parameters
| Parameter | Type | Description |
|---|---|---|
sharedGlobalName | string | The name of the shared global object that is used to hold the data written by the host. There should be at most one instance of SharedDataBusHost across all CoherentGT views for each unique shared global object. This API is still under development and should not be used for production code. |
Returns
SharedDataBusHost
Overrides
SharedDataBusClient.constructor
Properties
_isAlive
protectedreadonly_isAlive:Subject<boolean>
Defined in: src/sdk/data/SharedDataBus.ts:106
Experimental
Implementation of
SharedDataBusHost._isAlive
Inherited from
SharedDataBusClient._isAlive
data
protecteddata:Map<string,LabelEntry<any>>
Defined in: src/sdk/data/SharedDataBus.ts:103
Experimental
Implementation of
SharedDataBusHost.data
Inherited from
SharedDataBusClient.data
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.
Implementation of
SharedDataBusHost.isAlive
Inherited from
SharedDataBusClient.isAlive
localSubjects
protectedreadonlylocalSubjects:Map<string,Map<number,DistributedSubject<any>>>
Defined in: src/sdk/data/SharedDataBus.ts:104
Experimental
Implementation of
SharedDataBusHost.localSubjects
Inherited from
SharedDataBusClient.localSubjects
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.
Implementation of
SharedDataBusHost.sharedGlobalName
Inherited from
SharedDataBusClient.sharedGlobalName
typedImplementation
protectedreadonlytypedImplementation:TypedDataBusClient<Record<string,any>,number>
Defined in: src/sdk/data/SharedDataBus.ts:113
Experimental
Implementation of
SharedDataBusHost.typedImplementation
Inherited from
SharedDataBusClient.typedImplementation
Methods
createTypedImplementation()
protectedcreateTypedImplementation():TypedDataBusHost<Record<string,any>>
Defined in: src/sdk/data/SharedDataBus.ts:337
Experimental
Creates an object that can access any data item from this host and implements TypedDataBusHost.
Returns
TypedDataBusHost<Record<string, any>>
An object that can access any data item from this host and implements TypedDataBusHost.
Implementation of
SharedDataBusHost.createTypedImplementation
Overrides
SharedDataBusClient.createTypedImplementation
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.
Implementation of
SharedDataBusClient.getDataItemEntry
Inherited from
SharedDataBusClient.getDataItemEntry
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.
Implementation of
SharedDataBusHost.getDataItemEntryFromLabelEntry
Inherited from
SharedDataBusClient.getDataItemEntryFromLabelEntry
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.
Implementation of
SharedDataBusClient.getLabelEntry
Inherited from
SharedDataBusClient.getLabelEntry
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.
Implementation of
SharedDataBusClient.getLocalSubject
Inherited from
SharedDataBusClient.getLocalSubject
initSharedGlobal()
protectedinitSharedGlobal():Promise<void>
Defined in: src/sdk/data/SharedDataBus.ts:355
Experimental
Initializes the shared global object to which this host will write data.
Returns
Promise<void>
Implementation of
SharedDataBusHost.initSharedGlobal
Overrides
SharedDataBusClient.initSharedGlobal
of()
of<
R>():TypedDataBusHost<R>
Defined in: src/sdk/data/SharedDataBus.ts:348
Experimental
Type Parameters
| Type Parameter | Default type |
|---|---|
R extends Record<string, any> | Record<never, never> |
Returns
Inherit Doc
Implementation of
SharedDataBusHost.of
Overrides
SharedDataBusClient.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
Implementation of
SharedDataBusHost.setSharedData
Inherited from
SharedDataBusClient.setSharedData
update()
update():
void
Defined in: src/sdk/data/SharedDataBus.ts:413
Experimental
Returns
void
Inherit Doc
Implementation of
SharedDataBusHost.update
Overrides
SharedDataBusClient.update