step.background_manager¶
Background step manager — tracks running background tasks and handles preemption.
When a foreground step requires a resource held by a background step, the
background step is cancelled (preempted) with a warning instead of raising
ResourceConflictError. The manager also logs when background steps
complete, fail, or get cancelled.
Attributes¶
Classes¶
Track background step tasks and handle resource preemption. |
Functions¶
|
Get or create the |
Module Contents¶
- step.background_manager.logger¶
- class step.background_manager.BackgroundManager¶
Track background step tasks and handle resource preemption.
Attached to the robot instance as
robot._background_manager.- register(task: asyncio.Task[None], label: str, name: str | None, resources: frozenset[str]) None¶
Register a background task for tracking and preemption.
- async preempt_conflicts(resources: frozenset[str], holder_label: str) None¶
Cancel background tasks whose resources overlap with resources.
After cancellation, awaits cleanup so released resources are available for immediate acquisition.
- step.background_manager.get_background_manager(robot: object) BackgroundManager¶
Get or create the
BackgroundManagerattached to robot.