File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
src/frequenz/sdk/microgrid/client Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -119,3 +119,5 @@ This release replaces the `@actor` decorator with a new `Actor` class.
119119- Fix `consumer_power` and `producer_power` similar to `pv_power`
120120
121121- Zero value requests received by the `PowerDistributingActor` will now always be accepted, even when there are non- zero exclusion bounds.
122+
123+ - Hold on to a reference to all streaming tasks in the microgrid API client, so they don' t get garbage collected.
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ def __init__(
216216 self .target = target
217217 self .api = MicrogridStub (grpc_channel )
218218 self ._component_streams : Dict [int , Broadcast [Any ]] = {}
219+ self ._streaming_tasks : Dict [int , asyncio .Task [None ]] = {}
219220 self ._retry_spec = retry_spec
220221
221222 async def components (self ) -> Iterable [Component ]:
@@ -401,7 +402,7 @@ def _get_component_data_channel(
401402 chan = Broadcast [_GenericComponentData ](task_name )
402403 self ._component_streams [component_id ] = chan
403404
404- asyncio .create_task (
405+ self . _streaming_tasks [ component_id ] = asyncio .create_task (
405406 self ._component_data_task (
406407 component_id ,
407408 transform ,
You can’t perform that action at this time.
0 commit comments