skip to content
[readonly]

The job table: jobs with their done items, results, runs, failures and folds; applying ops as a join-semilattice (an item's first result wins)

sh
$ sexc add @ajax/mesh-jobs-table
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 05:24v/# 1 version
  • drwxr-xr-x-Oct 27 05:24files/# the files of 0.1.0
latest
0.1.0, published Oct 27 05:24 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-check ^0.1.0, @ajax/mesh-strbuf ^0.1.0, @ajax/mesh-omap ^0.1.0, @ajax/mesh-jobs-id ^0.1.0, @ajax/mesh-jobs-ranges ^0.1.0, @ajax/mesh-jobs-spec ^0.1.0, @ajax/mesh-jobs-op ^0.1.0
dependents
@ajax/mesh-jobs-log, @ajax/mesh-jobs-merge, @ajax/mesh-jobs-node
keywords
mesh alphaos jobs table crdt semilattice
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-jobs-table
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-jobs-table
2
3The job table: every job with what is known of it (done items, results, runs of done items without
4results, failures, retries counted, duplicates, cancel and finish, per-member counts, the fold of an
5endless job's runs, its presentation word), changed only by applying ops (@ajax/mesh-jobs-op).
6
7The table is a join-semilattice: every op is idempotent, and applying two tables' ops in either order
8gives their union, in which an item's first result wins. That is why a new leader of the fleet can
9merge a majority's tables without matching their logs (`@ajax/mesh-jobs-merge`).
10
11## Ported from
12
13[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT):
14`crates/mesh-host/src/jobs.rs`: `FIN_*`, `Job` (`fold`, `total`, `settled`, `lease_of`, `active`,
15`complete`, `state`, `left`), `Table` (`apply`, `ops`, `next_id`).
16
17## Tests
18
19- `tests/table.c`, the Rust's `ops_frames_and_the_merge`, table half: the ops round trip,
20  idempotence, the union in either order, a table rebuilt from its own ops, and `lease_of`.
21- `tests/table.c`, golden: four random sequences of 600 ops (every kind, folds and forgets included).
22  The identical generator runs in the Rust, and every 50 ops the hash and length of the encoded table
23  match the Rust's. So does the table rebuilt from its own ops, and whether it equals the original.
24  Then the whole sequence and `next_id` are compared.
25
26## Licence
27
28MIT. See the repository's LICENSE.