The job frames on the peer links (F_JOB_AVAIL, F_JOB_STATE, F_JOB_ACK, F_JOB_PULL, F_JOB_HAVE, F_LEASE, F_LEASE_CUT, F_RESULT): types, encoding, decoding
$ sexc add @ajax/mesh-jobs-frame- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 05:23v/# 1 version
- drwxr-xr-x-Oct 27 05:23files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 05:23 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-check ^0.1.0, @ajax/mesh-strbuf ^0.1.0, @ajax/mesh-abi-peer-frames ^0.1.0, @ajax/mesh-abi-peer-sizes ^0.1.0, @ajax/mesh-jobs-id ^0.1.0, @ajax/mesh-jobs-ranges ^0.1.0, @ajax/mesh-jobs-wire ^0.1.0, @ajax/mesh-jobs-spec ^0.1.0, @ajax/mesh-jobs-op ^0.1.0
- dependents
- @ajax/mesh-driver, @ajax/mesh-jobs-node, @ajax/mesh-jobs-out, @ajax/mesh-jobs-select, @ajax/mesh-shared
- keywords
- mesh alphaos jobs frames protocol
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-jobs-frame
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-jobs-frame 2 3The job frames on the peer links, and what they carry: 4 5| Frame | Carries | 6|---|---| 7| F_JOB_AVAIL | A member's job programs (`mj_prog`) and the leases it holds (`mj_held`) | 8| F_JOB_STATE | The replicated table: a delta, a part of a snapshot or replace, its end, a commit point (`ST_*`) | 9| F_JOB_ACK | A member persisted entries up to n (or reports a gap) | 10| F_JOB_PULL | A new leader asks for a member's table | 11| F_JOB_HAVE | The answer in numbered parts: the committed table, the entries not committed yet, the end with its leases (`HAVE_*`) | 12| F_LEASE | Items for a member to run (`mj_lease_msg`) | 13| F_LEASE_CUT | Drop a lease's items from `cut` on | 14| F_RESULT | Finished items (`mj_item_res`, statuses `RS_*`) | 15 16On the wire a frame is its type, a `u32` length (`JOB_HEAD`), then a body that starts with the 17leadership id. Parts are numbered and the end says how many there were, so a lost part is never taken 18for a whole table (review finding 9). 19 20## Ported from 21 22[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): 23`crates/mesh-host/src/jobs.rs`: `Prog`, `Held`, `LeaseMsg`, `ItemRes`, `RS_*`, `ST_*`, `HAVE_*`, 24`Frame` (`ty`, `lid`, `encode`, `decode`), `put_held`, `get_held`. 25 26## Tests 27 28`tests/frame.c`: the eleven frames of the Rust's `ops_frames_and_the_merge`, encoded byte for byte as 29the Rust encodes them (golden bytes from the Rust), decoded and cloned back. Then decode's answers, 30word for word the Rust's, to a bad HAVE kind, an unknown type, trailing bytes and short bodies. 31 32## Licence 33 34MIT. See the repository's LICENSE.