class documentation

class StartupGate:

Constructor: StartupGate(machinery_item)

View In Hierarchy

One machinery item's required Bindings, as the wait and the watch that follow from them.

Held by its ROS2StartupSkill. wait is called from the starting handler and close from the halting one and from shutdown. The graph watch and the loss watcher exist only between them.

Method __init__ Resolve what this item will wait for, and refuse an item that could not report it.
Async Method close Stop watching and let go of the graph. Idempotent.
Async Method wait Wait for every required Binding, then keep an eye on them.
Property prerequisites Return what this item's StartupSkill waits for, one entry per required Binding.
Property watching Return whether the gate is still following its prerequisites after a startup.
Async Method _follow Report a prerequisite that goes away after startup, and never act on it.
Async Method _open_the_graph Start reading the graph, if anything here can only be answered from it.
Async Method _report Fire one BindingEvent, and never let the reporting be the fault.
Async Method _report_absent Announce one prerequisite that missed its own deadline.
Instance Variable _emit Undocumented
Instance Variable _item Undocumented
Instance Variable _lost Undocumented
Instance Variable _prerequisites Undocumented
Instance Variable _watch Undocumented
Instance Variable _watcher Undocumented
def __init__(self, machinery_item: BaseMachineryItem):

Resolve what this item will wait for, and refuse an item that could not report it.

This is resolved at init, not at the first start, because both failures are declaration errors. Only how to ask is resolved here, never the answer.

Raises
DeclarationErrorWhen a required Binding's kind has no answer to what Satisfied means for it, or when the item cannot raise a BindingEvent.
async def close(self):

Stop watching and let go of the graph. Idempotent.

Called on the way to Halted and again at shutdown, for a Component torn down while the process goes on serving.

async def wait(self):

Wait for every required Binding, then keep an eye on them.

It re-runs on every start, so a resume after a crashed stack cannot claim Running on an old check.

Raises
OpenSmiRuntimeErrorWhen anything missed its deadline, carrying REQUIRED_BINDING_ABSENT as its code.
@property
prerequisites: tuple[Prerequisite, ...] =

Return what this item's StartupSkill waits for, one entry per required Binding.

@property
watching: bool =

Return whether the gate is still following its prerequisites after a startup.

async def _follow(self, prerequisites: Sequence[Prerequisite]):

Report a prerequisite that goes away after startup, and never act on it.

async def _open_the_graph(self, prerequisites: Sequence[Prerequisite]):

Start reading the graph, if anything here can only be answered from it.

The watch keeps the facet polling during the wait, and the read stops a service that is already there from costing a poll interval. Machines with only topic, parameter or node Bindings open neither.

async def _report(self, prerequisite: Prerequisite, code: str, severity: Severity, text: str):

Fire one BindingEvent, and never let the reporting be the fault.

async def _report_absent(self, prerequisite: Prerequisite):

Announce one prerequisite that missed its own deadline.

_emit: Any =

Undocumented

_item =

Undocumented

_lost: set[Prerequisite] =

Undocumented

_prerequisites =

Undocumented

_watch: GraphWatch | None =

Undocumented

_watcher: asyncio.Task[None] | None =

Undocumented