Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## New Features

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

## Bug Fixes

Expand Down
6 changes: 5 additions & 1 deletion src/frequenz/dispatch/_actor_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class DispatchInfo:
options: dict[str, Any]
"""Additional options."""

_src: Dispatch
"""The dispatch that triggered this update."""


class ActorDispatcher(BackgroundService):
"""Helper class to manage actors based on dispatches.
Expand Down Expand Up @@ -224,11 +227,12 @@ def start(self) -> None:
self._tasks.add(asyncio.create_task(self._run()))

async def _start_actor(self, dispatch: Dispatch) -> None:
"""Start all actors."""
"""Start the actor the given dispatch refers to."""
dispatch_update = DispatchInfo(
components=dispatch.target,
dry_run=dispatch.dry_run,
options=dispatch.payload,
_src=dispatch,
)

identity = self._dispatch_identity(dispatch)
Expand Down
Loading