Crate json_job_dispatch

Source
Expand description

A small library to dispatch job files to relevant handlers.

This library implements the core logic of a Director which dispatches jobs described in JSON files to a relevant Handler and then archives the job based on whether it was accepted or rejected.

§Job files

Job files are files ending in a .json extension in JSON format. Two keys are required:

  • kind: this string value is used to determine which handler will be used to handle the job.
  • data: this value is passed to the handler.

Other keys may be used (e.g., a timestamp to indicate when the job was created).

Job files are treated as read-only by the director.

Modules§

utils
Utilities for director-based tools.

Structs§

Director
Dispatch jobs to registered handlers.
DirectorWatchdog
A watchdog for the director.

Enums§

DirectorError
Errors which may occur when running a director.
JobResult
Results from an event.
Outbox
Outbox labels.
RunResult
The result of running jobs.

Traits§

Handler
Interface for handling events asynchronously.
HandlerCore
Interface for handling events.

Type Aliases§

JobError
An error which can occur when handling a job.