Remote / An event-sourced domain behind Remote
What the page can and cannot predict
The page predicts from the declaration, with no round trip:
- the fields the write sets (
reservedgoes from 2 to 5 as the write starts); - whether it would be refused, when asked (
Data.can): the guard, thewhen, the invariants.
It waits for the answer for:
- the revision, which the server moves;
- anything a hand-written
decidedoes that no declared write states; - everything an imported Command does: Remote treats its footprint as the fields that may have changed, and predicts nothing;
Reused,NotFound, and whatever Domain's own Policies or Sagas record afterwards.
A prediction never stops a write from being sent. In the example's trace, a reservation the invariant forbids is sent, decided and refused by the Aggregate; the page shows the refusal the declaration names.