Skip to main content
The backend_* tool surface every backend offers: its names, its refusal and its not-ready text. The kit registers the surface once over a backend’s seams: the ten schedule tools over its ScheduleStore (tai42_kit.backend.schedule_tools) and the twelve task and worker tools over its WorkerInspection (tai42_kit.backend.inspection_tools). A tool the backend cannot serve is still registered, and raises UnsupportedBackendTool when called. Each tool is registered through backend_tool as a tool of the backend package that registers the surface, not of the kit module that builds it.

BACKEND_TOOL_TAG

tai42_kit.backend.tool_surface.BACKEND_TOOL_TAG

SCHEDULE_TOOLS

tai42_kit.backend.tool_surface.SCHEDULE_TOOLS

INSPECTION_TOOLS

tai42_kit.backend.tool_surface.INSPECTION_TOOLS

BACKEND_TOOLS

tai42_kit.backend.tool_surface.BACKEND_TOOLS

backend_tool

tai42_kit.backend.tool_surface.backend_tool
The decorator registering one backend_* tool, tagged backend, as a tool of module. module is the backend package registering the surface. The host attributes a tool to the module its function names (__module__) and admits the tools of the package the manifest’s backend_module names, so the kit-built function is named into that package before it is registered. The builder modules keep their annotations evaluated, so a tool’s annotations resolve whichever module it names. Parameters

NOT_READY

tai42_kit.backend.tool_surface.NOT_READY

UnsupportedBackendTool

tai42_kit.backend.tool_surface.UnsupportedBackendTool
Raised by a backend_* tool, or one form of it, the backend cannot serve. Attributes The ten schedule tools every scheduling backend offers, built once over its schedule store. register_schedule_tools registers them over a backend’s ScheduleStore: list, get, update, enable, disable, run now, exists, delete, and the export/import pair. Each tool has one argument list and one reply on every backend; a status reply is {"status": ..., "name": name}. What a store cannot represent is refused here, by its declared capabilities: a disabled schedule on a store that holds none, a relative interval on a store that honours none.

NO_CHANGES

tai42_kit.backend.schedule_tools.NO_CHANGES

split_fired_tool

tai42_kit.backend.schedule_tools.split_fired_tool
The fired tool’s name and the remaining kwargs of a stored schedule’s job kwargs. kwargs is left untouched. A schedule without tool_name_arg in its kwargs was not created through the backend’s schedule door, and raises ValueError. Parameters

disabled_import_refusal

tai42_kit.backend.schedule_tools.disabled_import_refusal
The import error of a disabled record on a store that holds no disabled schedule. Parameters

register_schedule_tools

tai42_kit.backend.schedule_tools.register_schedule_tools
Register the ten schedule tools of one backend over store. settings is the backend’s settings accessor, read at each call for the tool-name argument the stored job kwargs carry the fired tool under. label is the backend’s name, as a refusal names it. module is the backend package the tools are registered as tools of (backend_tool). Parameters The twelve task and worker tools every backend offers, built once over its worker inspection. BackendInspection is the base a backend’s WorkerInspection builds on: each view it does not override refuses with UnsupportedBackendTool, and its capabilities default to False. register_inspection_tools registers the tools over it, each with one argument list on every backend; a worker_name the backend cannot address, or a terminate it cannot honour, is refused here before the view is reached.

BackendInspection

tai42_kit.backend.inspection_tools.BackendInspection
A backend’s worker inspection: every view refused until the backend implements it. label is the backend’s name, as a refusal names it. A subclass overrides the views its engine answers and sets addresses_workers / terminates when it can. Attributes

Members

addresses_workers

tai42_kit.backend.inspection_tools.BackendInspection.addresses_workers
Whether the views can narrow to one worker by its name; False unless overridden.

terminates

tai42_kit.backend.inspection_tools.BackendInspection.terminates
Whether cancel serves terminate=True; False unless overridden.

ping

tai42_kit.backend.inspection_tools.BackendInspection.ping
Ask the workers whether they are alive, and return their answers. Parameters

active_workers

tai42_kit.backend.inspection_tools.BackendInspection.active_workers
The names of the workers alive now.

task_status

tai42_kit.backend.inspection_tools.BackendInspection.task_status
The vendor’s status word for the task task_id. Parameters

task_result

tai42_kit.backend.inspection_tools.BackendInspection.task_result
The task’s (ready, status, value). Parameters

cancel

tai42_kit.backend.inspection_tools.BackendInspection.cancel
Cancel the task task_id; return what was done. Parameters

active_tasks

tai42_kit.backend.inspection_tools.BackendInspection.active_tasks
The tasks running now. Parameters

reserved_tasks

tai42_kit.backend.inspection_tools.BackendInspection.reserved_tasks
The tasks taken off the queue and waiting for a free worker slot.

scheduled_tasks

tai42_kit.backend.inspection_tools.BackendInspection.scheduled_tasks
The tasks waiting for a later time.

registered_tasks

tai42_kit.backend.inspection_tools.BackendInspection.registered_tasks
The task names the workers can run. Parameters

failed_tasks

tai42_kit.backend.inspection_tools.BackendInspection.failed_tasks
The tasks that failed.

worker_stats

tai42_kit.backend.inspection_tools.BackendInspection.worker_stats
The workers’ runtime statistics. Parameters

worker_queues

tai42_kit.backend.inspection_tools.BackendInspection.worker_queues
The queues the workers consume. Parameters

register_inspection_tools

tai42_kit.backend.inspection_tools.register_inspection_tools
Register the twelve task and worker tools of one backend over inspection. module is the backend package the tools are registered as tools of (backend_tool). Parameters