class
Rosegold::InventoryDispatch
- Rosegold::InventoryDispatch
- Reference
- Object
Overview
Orders one client's predicted menu clicks against guarded menu writes without holding any transport lock. A guarded intent is refused while another guarded intent or an ordinary click is in progress; an ordinary click waits only while a guarded write is flushing, so it predicts from committed state.
Defined in:
rosegold/inventory/inventory_dispatch.crInstance Method Summary
-
#begin_flush : Channel(Nil) | Nil
Called under the write lock once a guarded write is approved.
-
#end_flush(flush : Channel(Nil) | Nil) : Nil
Called under the write lock whether or not the write happened, so waiters resume before a failed write's
Disconnectedlisteners run. -
#guarded(& : -> Bool) : Bool
Runs one guarded intent, or returns false at once if another guarded intent or an ordinary click is still in progress.
-
#ordinary(&)
Waits out a flushing guarded write, then runs an ordinary click, yielding whether it waited.
- #predicted : Nil
-
#revision : UInt64
Counts ordinary click predictions; guarded intents refuse if it moves.
Instance Method Detail
Called under the write lock once a guarded write is approved. Returns nil, refusing it, while an ordinary click is in progress.
Called under the write lock whether or not the write happened, so waiters
resume before a failed write's Disconnected listeners run.
Runs one guarded intent, or returns false at once if another guarded intent or an ordinary click is still in progress.
Waits out a flushing guarded write, then runs an ordinary click, yielding whether it waited. Nothing is held while the block runs.