skip to content
==> README.md <==
1# @ajax/mesh-jobs-op
2
3An edit of the job table, and the binary encoding of edits. Kinds: submit, cancel, done (with a
4result), done-run (a range done with result 0), fail, fails (tries so far), dupes, finish, forget,
5fold, and tone. An op also carries item results (`mj_res`) and payload references (`mj_blob_ref`:
6sha256, length, holders). Encoded, an op is a `u8` tag and its fields (@ajax/mesh-jobs-wire). Ops
7travel in parts of at most `PART_BYTES` (1 MiB) each; an op is never split.
8
9## Ported from
10
11[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT):
12`crates/mesh-host/src/jobs.rs`: `Res`, `BlobRef`, `Op`, `put_op`, `get_op`, `encode_ops`,
13`decode_ops`, `parts`, `PART_BYTES`.
14
15## Tests
16
17`tests/op.c`:
18- one op of each kind, encoded byte for byte as the Rust encodes them (golden bytes from the Rust);
19- decoding back, and deep clones;
20- decode's answers to bad bytes, word for word the Rust's: an unknown tag, a fold of 9 members, a blob
21  tag 2, a short read, a bad spec, bad UTF-8;
22- parts of a 3 MiB op stream.
23
24## Licence
25
26MIT. See the repository's LICENSE.