Class: SharedDataBusHost
Defined in: src/sdk/data/SharedDataBus.ts:297
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:306
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:114
Experimental
Implementation of
SharedDataBusHost._isAlive
Inherited from
SharedDataBusClient._isAlive
data
protecteddata:Map<string,LabelEntry<any>>
Defined in: src/sdk/data/SharedDataBus.ts:111
Experimental
Implementation of
SharedDataBusHost.data
Inherited from
SharedDataBusClient.data
isAlive
readonlyisAlive:Subscribable<boolean>
Defined in: src/sdk/data/SharedDataBus.ts:119
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:112
Experimental
Implementation of
SharedDataBusHost.localSubjects
Inherited from
SharedDataBusClient.localSubjects
sharedGlobalName
protectedreadonlysharedGlobalName:string
Defined in: src/sdk/data/SharedDataBus.ts:128
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:121
Experimental
Implementation of
SharedDataBusHost.typedImplementation
Inherited from
SharedDataBusClient.typedImplementation
Methods
createTypedImplementation()
protectedcreateTypedImplementation():TypedDataBusHost<Record<string,any>>
Defined in: src/sdk/data/SharedDataBus.ts:314
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:274
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:249
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:409
Experimental
Type Parameters
| Type Parameter |
|---|
R extends Record<string, any> |
L extends string |
Parameters
| Parameter | Type |
|---|---|
label | L |
Returns
LabelEntry<R[L]>
Inherit Doc
Implementation of
SharedDataBusHost.getLabelEntry
Overrides
SharedDataBusClient.getLabelEntry
initSharedGlobal()
protectedinitSharedGlobal():Promise<void>
Defined in: src/sdk/data/SharedDataBus.ts:374
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:367
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:180
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:421
Experimental
Returns
void
Inherit Doc
Implementation of
SharedDataBusHost.update
Overrides
SharedDataBusClient.update