doot.control.runner._interface

Type Aliases

Handler

Protocols

RunnerHandlers_p

Base class for protocol classes.

WorkflowRunner_p

Run tasks, actions, and jobs

Module Contents

doot.control.runner._interface.Handler: TypeAlias = bool | type[ContextManager] | ContextManager
class doot.control.runner._interface.RunnerHandlers_p[source]

Bases: 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:
        ...
run_next_task() None[source]
Return type:

None

handle_success(
task: RunnerHandlers_p.handle_success.T,
) RunnerHandlers_p.handle_success.T[source]
Parameters:

task (RunnerHandlers_p.handle_success.T)

Return type:

RunnerHandlers_p.handle_success.T

handle_failure(failure: Exception) None[source]
Parameters:

failure (Exception)

Return type:

None

notify_artifact(
art: doot.workflow._interface.Artifact_i,
) None[source]
Parameters:

art (doot.workflow._interface.Artifact_i)

Return type:

None

sleep_after(
task: jgdv.Maybe[doot.workflow._interface.Task_p | doot.workflow._interface.Artifact_i],
) None[source]
Parameters:

task (jgdv.Maybe[doot.workflow._interface.Task_p | doot.workflow._interface.Artifact_i])

Return type:

None

class doot.control.runner._interface.WorkflowRunner_p(
*,
tracker: doot.control.tracker._interface.WorkflowTracker_p,
)[source]

Bases: Protocol

Run tasks, actions, and jobs

Parameters:

tracker (doot.control.tracker._interface.WorkflowTracker_p)