Commit fbaeab9
committed
Store a reference to the engine in receiver objects
This is a hack to ensure that the lifetime of the engine is tied to the
lifetime of the receiver. This is necessary because the engine is a task that
runs forever, and in cases where higher order built for example with the below
idiom, the user would hold no references to the engine and it could get
garbage collected before the receiver.
formula = (grid_power_engine + bat_power_engine).build().new_receiver()
Signed-off-by: Sahas Subramanian <[email protected]>1 parent 04de58a commit fbaeab9
File tree
1 file changed
+13
-1
lines changed- src/frequenz/sdk/timeseries/_formula_engine
1 file changed
+13
-1
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
| |||
0 commit comments