.. _doot.control.runner._interface: ============================== doot.control.runner._interface ============================== .. py:module:: doot.control.runner._interface Type Aliases ------------ .. autoapisummary:: doot.control.runner._interface.Handler Protocols --------- .. autoapisummary:: doot.control.runner._interface.RunnerHandlers_p doot.control.runner._interface.WorkflowRunner_p Module Contents =============== .. py:data:: Handler :type: TypeAlias :value: bool | type[ContextManager] | ContextManager .. _doot.control.runner._interface.RunnerHandlers_p: .. py:class:: RunnerHandlers_p Bases: :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing). For example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto[T](Protocol): def meth(self) -> T: ... .. py:method:: run_next_task() -> None .. py:method:: handle_success(task: RunnerHandlers_p.handle_success.T) -> RunnerHandlers_p.handle_success.T .. py:method:: handle_failure(failure: Exception) -> None .. py:method:: notify_artifact(art: doot.workflow._interface.Artifact_i) -> None .. py:method:: sleep_after(task: jgdv.Maybe[doot.workflow._interface.Task_p | doot.workflow._interface.Artifact_i]) -> None .. _doot.control.runner._interface.WorkflowRunner_p: .. py:class:: WorkflowRunner_p(*, tracker: doot.control.tracker._interface.WorkflowTracker_p) Bases: :py:obj:`Protocol` Run tasks, actions, and jobs