Skip to content

Commit 66f01dd

Browse files
committed
Update bound-streaming channels to resend latest to new receivers
The `SystemBoundsTracker`s send out a new value only when there's a change in the system bounds. This means when a new receiver is created, it could wait for a long time before receiving the bounds. This change allows new receivers to get the latest state when requested. This is already the case for battery bounds, and needed only for PV and EV charger bounds. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 998ebff commit 66f01dd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/frequenz/sdk/timeseries/ev_charger_pool/_ev_charger_pool_reference_store.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ def __init__( # pylint: disable=too-many-arguments
9393
)
9494

9595
self.bounds_channel: Broadcast[SystemBounds] = Broadcast(
96-
name=f"System Bounds for EV Chargers: {component_ids}"
96+
name=f"System Bounds for EV Chargers: {component_ids}",
97+
resend_latest=True,
9798
)
9899
self.bounds_tracker: EVCSystemBoundsTracker = EVCSystemBoundsTracker(
99100
self.component_ids,

src/frequenz/sdk/timeseries/pv_pool/_pv_pool_reference_store.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def __init__( # pylint: disable=too-many-arguments
9494
self.resampler_subscription_sender,
9595
)
9696
self.bounds_channel: Broadcast[SystemBounds] = Broadcast(
97-
name=f"System Bounds for PV inverters: {component_ids}"
97+
name=f"System Bounds for PV inverters: {component_ids}",
98+
resend_latest=True,
9899
)
99100
self.bounds_tracker: PVSystemBoundsTracker = PVSystemBoundsTracker(
100101
self.component_ids,

0 commit comments

Comments
 (0)