Skip to main content

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

ParameterTypeDescription
sharedGlobalNamestringThe 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

protected readonly _isAlive: Subject<boolean>

Defined in: src/sdk/data/SharedDataBus.ts:114

Experimental

Implementation of

SharedDataBusHost._isAlive

Inherited from

SharedDataBusClient._isAlive


data

protected data: Map<string, LabelEntry<any>>

Defined in: src/sdk/data/SharedDataBus.ts:111

Experimental

Implementation of

SharedDataBusHost.data

Inherited from

SharedDataBusClient.data


isAlive

readonly isAlive: 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

protected readonly localSubjects: Map<string, Map<number, DistributedSubject<any>>>

Defined in: src/sdk/data/SharedDataBus.ts:112

Experimental

Implementation of

SharedDataBusHost.localSubjects

Inherited from

SharedDataBusClient.localSubjects


sharedGlobalName

protected readonly sharedGlobalName: 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

protected readonly typedImplementation: TypedDataBusClient<Record<string, any>, number>

Defined in: src/sdk/data/SharedDataBus.ts:121

Experimental

Implementation of

SharedDataBusHost.typedImplementation

Inherited from

SharedDataBusClient.typedImplementation

Methods

createTypedImplementation()

protected createTypedImplementation(): 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()

protected getDataItemEntry<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 ParameterDescription
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 stringThe label of the data item entry to get.

Parameters

ParameterTypeDescription
labelLThe label of the data item entry to get.
indexnumberThe 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()

protected getDataItemEntryFromLabelEntry<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 ParameterDescription
TThe type of the data item's value.

Parameters

ParameterTypeDescription
labelEntryLabelEntry<T>The label entry from which to get the data item entry.
indexnumberThe 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()

protected getLabelEntry<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

ParameterType
labelL

Returns

LabelEntry<R[L]>

Inherit Doc

Implementation of

SharedDataBusHost.getLabelEntry

Overrides

SharedDataBusClient.getLabelEntry


initSharedGlobal()

protected initSharedGlobal(): 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 ParameterDefault type
R extends Record<string, any>Record<never, never>

Returns

TypedDataBusHost<R>

Inherit Doc

Implementation of

SharedDataBusHost.of

Overrides

SharedDataBusClient.of


setSharedData()

protected setSharedData(data): void

Defined in: src/sdk/data/SharedDataBus.ts:180

Experimental

Sets the shared data object used by this client.

Parameters

ParameterTypeDescription
dataMap<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