Class ClientUnobservableProperty¶
- class sila2.client.ClientUnobservableProperty(parent_feature: ClientFeature, wrapped_property: UnobservableProperty)¶
Wraps an unobservable property
- get(*, metadata: typing.Iterable[ClientMetadataInstance] | None = None) ItemType ¶
Get the current value
- Parameters:
metadata – SiLA Client Metadata to send along with the subscription request
- Returns:
value – Current property value
- subscribe_by_polling(poll_interval: float, *, metadata: typing.Iterable[ClientMetadataInstance] | None = None) Subscription[ItemType] ¶
Subscribe to value updates by repeatedly calling
get()
in a background thread.- Parameters:
poll_interval – Time in seconds between calling
get()
metadata – SiLA Client Metadata to send along with the subscription request
- Returns:
subscription – Property value subscription
Notes
When receiving the same value multiple times in a row, it is only emitted once. This simulates the subscription behavior of observable properties, which can be used to “observe any change of its value”.