File tree 2 files changed +3
-2
lines changed
src/frequenz/sdk/microgrid/client
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Bug Fixes
4
4
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__(
197
197
self .target = target
198
198
self .api = MicrogridStub (grpc_channel )
199
199
self ._component_streams : Dict [int , Broadcast [Any ]] = {}
200
+ self ._streaming_tasks : Dict [int , asyncio .Task [None ]] = {}
200
201
self ._retry_spec = retry_spec
201
202
202
203
async def components (self ) -> Iterable [Component ]:
@@ -375,7 +376,7 @@ def _get_component_data_channel(
375
376
chan = Broadcast [_GenericComponentData ](task_name )
376
377
self ._component_streams [component_id ] = chan
377
378
378
- asyncio .create_task (
379
+ self . _streaming_tasks [ component_id ] = asyncio .create_task (
379
380
self ._component_data_task (
380
381
component_id ,
381
382
transform ,
You can’t perform that action at this time.
0 commit comments