Class: SharedDataBusHost
Defined in: src/sdk/data/SharedDataBus.ts:318
Experimental
A host of data that is stored in a global object shared between instruments, which allows for the host to update the data to multiple subscriber instruments. This API is still under development and should not be used for production code.
Extends
Constructors
Constructor
new SharedDataBusHost(
sharedGlobalName
):SharedDataBusHost
Defined in: src/sdk/data/SharedDataBus.ts:190
Experimental
Creates an instance of SharedDataBushost.
Parameters
Parameter | Type | Description |
---|---|---|
sharedGlobalName | string | The name of the shared global object that will hold the data. This API is still under development and should not be used for production code. |
Returns
SharedDataBusHost
Inherited from
SharedDataBusClient
.constructor
Properties
_isAlive
protected
readonly
_isAlive:Subject
<boolean
>
Defined in: src/sdk/data/SharedDataBus.ts:178
Experimental
Inherited from
data
protected
data:Map
<string
,Map
<number
,DataItem
<any
>>>
Defined in: src/sdk/data/SharedDataBus.ts:175
Experimental
Inherited from
isAlive
readonly
isAlive:Subscribable
<boolean
>
Defined in: src/sdk/data/SharedDataBus.ts:183
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.
Inherited from
localSubjects
protected
localSubjects:Map
<string
,Map
<number
,DistributedSubject
<any
>>>
Defined in: src/sdk/data/SharedDataBus.ts:176
Experimental
Inherited from
SharedDataBusClient
.localSubjects
sharedGlobalName
protected
sharedGlobalName:string
Defined in: src/sdk/data/SharedDataBus.ts:190
Experimental
The name of the shared global object that will hold the data. This API is still under development and should not be used for production code.
Inherited from
SharedDataBusClient
.sharedGlobalName
Methods
getDataItem()
protected
getDataItem<T
,K
>(key
,sourceId
):DataItem
<T
[K
]>
Defined in: src/sdk/data/SharedDataBus.ts:278
Experimental
Gets the data item from the shared storage.
Type Parameters
Type Parameter | Default type |
---|---|
T | - |
K extends string | keyof T & string |
Parameters
Parameter | Type | Description |
---|---|---|
key | K | The key to the data item. |
sourceId | number | The ID of the data item source. |
Returns
DataItem
<T
[K
]>
The requested data item. This API is still under development and should not be used for production code.
Inherited from
SharedDataBusClient
.getDataItem
getSubscribable()
getSubscribable<
T
,K
>(key
,sourceId
):Subscribable
<Readonly
<DataItemValue
<T
[K
]>>>
Defined in: src/sdk/data/SharedDataBus.ts:253
Experimental
Gets a subscribable for a data item.
Type Parameters
Type Parameter | Default type |
---|---|
T | - |
K extends string | keyof T & string |
Parameters
Parameter | Type | Description |
---|---|---|
key | K | The key of the data item. |
sourceId | number | The ID of the source to get the data item from. |
Returns
Subscribable
<Readonly
<DataItemValue
<T
[K
]>>>
The requested subscribable. This API is still under development and should not be used for production code.
Inherited from
SharedDataBusClient
.getSubscribable
initSharedGlobal()
protected
initSharedGlobal():Promise
<void
>
Defined in: src/sdk/data/SharedDataBus.ts:333
Experimental
Creates the shared global to store data in. This API is still under development and should not be used for production code.
Returns
Promise
<void
>
Overrides
SharedDataBusClient
.initSharedGlobal
of()
of<
T
>():TypedDataBusHost
<T
>
Defined in: src/sdk/data/SharedDataBus.ts:325
Experimental
Applies an data items type to the data bus.
Type Parameters
Type Parameter |
---|
T |
Returns
The data bus with the data items type applied. This API is still under development and should not be used for production code.
Overrides
publish()
Publishes a value update to the data bus.
Param
The data key to publish to.
Param
The ID of the source of the data.
Param
The value to publish, or undefined for data with a NoValue status. If undefined is provided with a non-NoValue status, then the value will be ignored.
Param
An optional status to publish along with the value. This API is still under development and should not be used for production code.
Call Signature
publish<
T
,K
>(key
,sourceId
,value
):void
Defined in: src/sdk/data/SharedDataBus.ts:360
Experimental
Publishes a value update to the data bus.
Type Parameters
Type Parameter | Default type |
---|---|
T | - |
K extends string | keyof T & string |
Parameters
Parameter | Type | Description |
---|---|---|
key | K | The data key to publish to. |
sourceId | number | The ID of the source of the data. |
value | T [K ] | The value to publish. This API is still under development and should not be used for production code. |
Returns
void
Call Signature
publish<
T
,K
>(key
,sourceId
,value
,status
):void
Defined in: src/sdk/data/SharedDataBus.ts:369
Experimental
Publishes a no-value update to the data bus.
Type Parameters
Type Parameter | Default type |
---|---|
T | - |
K extends string | keyof T & string |
Parameters
Parameter | Type | Description |
---|---|---|
key | K | The data key to publish to. |
sourceId | number | The ID of the source of the data. |
value | undefined | The value to publish, which must be undefined. |
status | NoValue | A status to publish along with the value, which must be NoValue. This API is still under development and should not be used for production code. |
Returns
void
Call Signature
publish<
T
,K
>(key
,sourceId
,value
,status
):void
Defined in: src/sdk/data/SharedDataBus.ts:378
Experimental
Publishes a value and status update to the data bus.
Type Parameters
Type Parameter | Default type |
---|---|
T | - |
K extends string | keyof T & string |
Parameters
Parameter | Type | Description |
---|---|---|
key | K | The data key to publish to. |
sourceId | number | The ID of the source of the data. |
value | T [K ] | The value to publish. |
status | Failed | Testing | Normal | A status to publish along with the value. This API is still under development and should not be used for production code. |
Returns
void
update()
update():
void
Defined in: src/sdk/data/SharedDataBus.ts:304
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