About
Fewer moving parts: jobs live in the database you already run, commit or roll back with your own changes, and are backed up with your data. Anything from a quick email to long-running work, scheduled, prioritised and retried with backoff.
Install
From Hypha's opam repository, on OCaml 5.5 or later:
opam repo add hypha https://github.com/hyphatech/opam-repository.git
opam install spoolThen in your dune file:
(libraries spool rowtype-postgres eio_main)In code
A kind: its name, its payload's Wiretype description and its queue. Enqueued in the caller's transaction.
let receipt = Spool.Kind.make ~queue:"mail" ~timeout:Mtime.Span.min "receipt.send" order (* in the caller's transaction, through its own connection *) Spool.enqueue conn ~now ~unique:order_id receipt order_idA runner, with two workers on the mail queue.
let runner = Spool.Runner.create ~sw ~net ~mono_clock ~now ~queues:[ ("mail", 2) ] [ Spool.handle receipt (fun _job order_id -> send_receipt order_id) ] conninfo in Spool.Runner.start runner
Ontology
- EventQueuewaits in
- QueueJobfeeds
- ScheduleJobstarts
- JobStatementruns
Build with Hypha.
Talk to us
Bring a product or an idea.
Read the code
The components are open: source, tests and documentation.
Read the principles
The argument in full, in seven propositions.
