Structures · Coordination

OrderedCollection

Give one queued job to one worker without duplicate ownership.

Set the Eagle Creek problem first

The ranger queue contains one bridge inspection while three hikers request it.

Each person carries a work queue card. When a person makes a change, they copy it onto a acquire slip with the identity, path, sequence, or acceptance evidence that the rule needs. The demo shows both the local record and the note that travels.

An ordinary local edit names a position or value. That name can become stale while another client works. Watershed's ordered_collection_kernel uses this structure's rule to produce one shared result.

A OrderedCollection applies this rule to the shared record.

Run the conflict

Alice and Bob act before either receives the other operation. Carol stays connected as the third replica and confirms the converged view.

Three Eagle Creek clients

OrderedCollection authored race

The ranger queue contains one bridge inspection while three hikers request it.

Watershed ruleThe sequencer grants each queued item to the first accepted acquire.

Alice

Work queue card Queue: inspect bridge

Acquire slip Acquire next job requester Alice · awaits sequence

Bob

Work queue card Queue: inspect bridge

Acquire slip Acquire next job requester Bob · awaits sequence

Carol

Work queue card Queue: inspect bridge

Acquire slip Acquire next job requester Carol · awaits sequence

Shared view
  • Queue: inspect bridge

Enable JavaScript to run the race. The expected result remains in the lesson.

Ready: Queue: inspect bridge

Read the result

Accept one acquire. Bob and Carol cannot receive the same job.

The demo models the authored race from Watershed's public structure examples. The lesson keeps the conflict rule visible before exposing its metadata or protocol.