Skip to main content
The three dispatching branch tools every backend offers, built once over its seams. register_task_branches registers the three BACKEND tool extensions. Each factory receives (func, name, description) and returns a new-named branch tool bound alongside the original:
  • <tool>_sync_task queues the call and waits for its result;
  • <tool>_async_task queues the call and replies with the job’s id;
  • <tool>_schedule_task writes a recurring schedule firing the tool.
A branch’s signature is the tool’s own parameters widened with the branch’s options (built with makefun, so a tool caller sees real parameters). A backend supplies only its seams: the TaskDoor its task branches queue through, and the ScheduleWriter its schedule branch writes through.

SYNC_TASK_EXTENSION

tai42_kit.backend.branches.SYNC_TASK_EXTENSION

ASYNC_TASK_EXTENSION

tai42_kit.backend.branches.ASYNC_TASK_EXTENSION

register_task_branches

tai42_kit.backend.branches.register_task_branches
Register the sync, async and schedule branch extensions of one backend. settings is the backend’s settings accessor, read at each dispatch (the tool-name argument, the sync wait’s timeout). label is the backend’s name, as a refusal names it. Parameters The options a dispatching branch tool takes beyond the tool’s own arguments, and their split. BACKEND_TASK_OPTS are the task options every backend honours; a backend adds its own through task_opts. SCHEDULE_OPTS are the schedule branch’s own arguments. Each becomes a keyword argument of the branch tool, so a dispatch’s kwargs carry them beside the tool’s arguments until split_task_options takes them out.

CALLBACK_OPTION

tai42_kit.backend.task_options.CALLBACK_OPTION

BACKEND_TASK_OPTS

tai42_kit.backend.task_options.BACKEND_TASK_OPTS

SCHEDULE_OPTS

tai42_kit.backend.task_options.SCHEDULE_OPTS

split_task_options

tai42_kit.backend.task_options.split_task_options
Pop every option named in opts out of kwargs; return those the caller gave a value. An option whose value is None was not given and is dropped; every other value, a falsy one included, is kept. Parameters

take_callback

tai42_kit.backend.task_options.take_callback
Pop the callback out of the split options; carry onto it what its follow-up job needs. A callback given as a plain mapping is validated into a CallbackSchema (an invalid one raises ValidationError). kwargs are the job’s prepared kwargs: the forwarded door pair the follow-up job needs is read from them (carry_forwarded_fire). Parameters Worker queue labels and the queue name each derives. A label (letters, digits, _, -) names a worker pool. Its queue is <settings queue>.<label>: a label holds no . or :, so a derived name never equals the settings queue, nor any key a backend builds by suffixing the settings queue with :. A worker CLI takes the label through queue_label_option.

QUEUE_LABEL_PATTERN

tai42_kit.backend.queue_labels.QUEUE_LABEL_PATTERN

check_queue_label

tai42_kit.backend.queue_labels.check_queue_label
Return label, or raise ValueError when it is not letters, digits, _ or -. Parameters

derived_queue

tai42_kit.backend.queue_labels.derived_queue
The queue name for label under settings_queue; None is settings_queue itself. Parameters

queue_label_option

tai42_kit.backend.queue_labels.queue_label_option
The click callback of a worker’s --queue option: the checked label, or None when unset. A label outside the grammar raises click.BadParameter naming the option. Parameters What every schedule write door shares: the cadence check and the stored job kwargs. Each door that writes a schedule (the schedule branch tool, update, import) checks the cadence against the backend’s ScheduleWriter before it writes; the writer stores the record’s tool inside the job kwargs it fires with.

check_cadence_supported

tai42_kit.backend.schedule_writes.check_cadence_supported
Raise ValueError when writer cannot honour cadence; label names the backend. Parameters

fired_kwargs

tai42_kit.backend.schedule_writes.fired_kwargs
The job kwargs record fires with: its kwargs plus its tool under tool_name_arg. Parameters