Skip to content

Commit 67f1b92

Browse files
committed
Add DispatchInfo._src for when requiring more context
Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 7ee770f commit 67f1b92

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## New Features
1212

13-
<!-- Here goes the main new features and examples or instructions on how to use them -->
13+
- `DispatchInfo._src` was added for rare complex scenarios where the source of a dispatch needs to be accessed.
1414

1515
## Bug Fixes
1616

src/frequenz/dispatch/_actor_dispatcher.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class DispatchInfo:
3232
options: dict[str, Any]
3333
"""Additional options."""
3434

35+
_src: Dispatch
36+
"""The dispatch that triggered this update."""
37+
3538

3639
class ActorDispatcher(BackgroundService):
3740
"""Helper class to manage actors based on dispatches.
@@ -229,6 +232,7 @@ async def _start_actor(self, dispatch: Dispatch) -> None:
229232
components=dispatch.target,
230233
dry_run=dispatch.dry_run,
231234
options=dispatch.payload,
235+
_src=dispatch,
232236
)
233237

234238
identity = self._dispatch_identity(dispatch)

0 commit comments

Comments
 (0)