Skip to main content

Module kanban

Module kanban 

Source
Expand description

The Kanban’s side of the sync layer (SPEC_SHARED_KANBAN_ACROSS_MACHINES §3.3, build step K1): what a board’s tasks look like as records in the change log, and the merge rule for each kind of record.

capture reads the Kanban’s tables and writes whatever changed since the last capture into the log of the task’s board, one record per field (so two machines editing different fields of a card both keep their edit), one for the task’s lifecycle (state, holder, attempts, result: these move together), one per dependency and one per history line. It sends nothing and changes no Kanban table: taking a record from another machine into the tables comes with the numbering of the next step. A lease’s expiry is not recorded (every heartbeat would write a row); the number a card has on a machine is not either (numbers are per board, see the spec §3.2).

Records of a board are in the collection collection_id names; a record id is <task>.<field>, <task>.life, <task>.after.<other task> or <task>.event.<machine>.<line>.

Structs§

Captured
What a capture did.
KanbanAdapter
The Kanban’s merge rule: a field, the lifecycle, a dependency: the newest version is current (a deletion is the newest version of its record, so it wins over an older edit and loses to a newer one); a history line is written once, and the first one held stays. Which machine may write a task’s lifecycle (its home) comes with the home field of the numbering step.

Constants§

KIND
The kind of a Kanban board’s collection.

Functions§

capture
Writes into the log whatever changed in the Kanban since the last capture. default_board is the board a task with no board of its own is on. Safe to run again at any time: a record is written only when its value differs from what the log holds, so a run that stopped half way is finished by the next.
collection_id
The collection a board’s records are in.
init
Creates the log’s tables and this module’s.