WorkQueue

A distributed set of pending task IDs — the task-distribution primitive for :kuilt-warp.

Backed by an ORSet, so concurrent adds from multiple peers merge correctly (add-wins), and a task removed by one peer while concurrently re-added by another still survives. Tasks added during a network partition are preserved and merged on reconnect.

Ring-agnostic. WorkQueue holds all pending tasks; filtering to the tasks owned by the local peer (owner(task) == self) is done externally by the WarpNode via the TaskRing. This keeps the CRDT layer clean and makes the queue independently testable.

Immutable: add and remove return a new instance. merge is the causal join.

Type Parameters

TaskId

the type used to identify tasks — must be a stable, unique, serializable key.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The set of task IDs currently pending.

Functions

Link copied to clipboard
fun add(replica: ReplicaId, taskId: TaskId): WorkQueue<TaskId>

Add taskId to the pending set on behalf of replica.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

The causal merge of two replicas of this queue.

Link copied to clipboard
fun remove(taskId: TaskId): WorkQueue<TaskId>

Remove taskId from the pending set.

Link copied to clipboard
open override fun toString(): String