File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
src/frequenz/sdk/microgrid/client Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 22
33## Bug Fixes
44
5- - Ping ` pypantic ` version to ` < 2 ` .
5+ - 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 @@ -197,6 +197,7 @@ def __init__(
197197 self .target = target
198198 self .api = MicrogridStub (grpc_channel )
199199 self ._component_streams : Dict [int , Broadcast [Any ]] = {}
200+ self ._streaming_tasks : Dict [int , asyncio .Task [None ]] = {}
200201 self ._retry_spec = retry_spec
201202
202203 async def components (self ) -> Iterable [Component ]:
@@ -375,7 +376,7 @@ def _get_component_data_channel(
375376 chan = Broadcast [_GenericComponentData ](task_name )
376377 self ._component_streams [component_id ] = chan
377378
378- asyncio .create_task (
379+ self . _streaming_tasks [ component_id ] = asyncio .create_task (
379380 self ._component_data_task (
380381 component_id ,
381382 transform ,
You can’t perform that action at this time.
0 commit comments