#events #task


Dispatch jobs described by JSON files and sort them according to their status

11 stable releases

3.0.2 May 30, 2023
3.0.1 Apr 10, 2022
3.0.0 Nov 22, 2021
2.0.1 Nov 19, 2019
1.0.1 Jan 18, 2017

#103 in Compression

Download history 10/week @ 2023-06-08 11/week @ 2023-06-15 18/week @ 2023-06-22 21/week @ 2023-06-29 10/week @ 2023-07-06 8/week @ 2023-07-13 9/week @ 2023-07-20 14/week @ 2023-07-27 12/week @ 2023-08-03 22/week @ 2023-08-10 20/week @ 2023-08-17 28/week @ 2023-08-24 11/week @ 2023-08-31 44/week @ 2023-09-07 14/week @ 2023-09-14 10/week @ 2023-09-21

80 downloads per month



JSON Job Dispatch

A library which watches a directory using inotify for .json job files and dispatches them to registered handlers. Jobs are archived into accept/ and reject/ directories for auditing purposes. Additionally, companion files with a datestamp of when the job was handled and, for rejected jobs, a file containing the reason for the rejection is also created.

The design goal is to allow the daemon handling jobs to crash and be resiliant against crashes by using the filesystem as a simple object store for jobs which need handled and an archive of completed jobs. Atomic renames are used to relocate files, so the input directory must reside on the same filesystem as the archival directories.


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.


~654K SLoC