Crate json_job_dispatch[][src]

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.

Error

The Error type.

Enums

ErrorKind

The kind of an error.

HandlerResult

Results from an event.

RunResult

The result of running jobs.

Traits

Handler

Interface for handling events.

ResultExt

Additional methods for Result, for easy interaction with this crate.

Type Definitions

Result

Convenient wrapper around std::Result.