Skip to content

Commit

Permalink
Pass in reference to the BlueprintPlanner to display updated state
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Mar 30, 2024
1 parent d7093c6 commit 7f5c246
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/brad/daemon/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ async def run_forever(self) -> None:
]
additional_tasks = []
if self._ui_mgr is not None:
self._ui_mgr.set_planner(self._planner)
additional_tasks.append(self._ui_mgr.serve_forever())
logger.info("The BRAD daemon is running.")
if self._system_event_logger is not None:
Expand Down
4 changes: 4 additions & 0 deletions src/brad/ui/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from brad.daemon.monitor import Monitor
from brad.blueprint.manager import BlueprintManager
from brad.daemon.system_event_logger import SystemEventLogger
from brad.planner.abstract import BlueprintPlanner


class UiManager:
Expand Down Expand Up @@ -47,5 +48,8 @@ def __init__(self, impl: Any) -> None:

self._impl: UiManagerImpl = impl

def set_planner(self, planner: BlueprintPlanner) -> None:
self._impl.planner = planner

async def serve_forever(self) -> None:
await self._impl.serve_forever()

0 comments on commit 7f5c246

Please sign in to comment.