Class ActionTracker

java.lang.Object
privbot.actions.confirm.ActionTracker

public final class ActionTracker extends Object
Tracks already-dispatched actions without a polling thread. Client reads run outside the tracker monitor. Each terminal result is published once by poll(), subject to the bounded buffer. Independent of the blocking, retrying confirmation the Workflow Studio uses when it replays recorded actions.
  • Constructor Details

    • ActionTracker

      public ActionTracker()
    • ActionTracker

      public ActionTracker(LongSupplier nanoClock, int capacity)
  • Method Details

    • guardCurrentGeneration

      public BooleanSupplier guardCurrentGeneration(BooleanSupplier active)
      Capture before dispatch so a later registration cannot adopt an obsolete session's action.
    • track

      public ActionHandle track(String label, DispatchStatus dispatch, Supplier<ProofState> proof, BooleanSupplier active, long timeoutMs)
      Record one dispatch. Capture any before-state before dispatch, then supply a fresh proof read. An unacknowledged void attempt may confirm from game state but never gains an accepted receipt. At capacity the oldest pending handle is cancelled; completed handles remain terminal forever.
    • poll

      public List<ActionSnapshot> poll()
      Poll each retained action once, returning current pending and newly terminal observations.
    • invalidate

      public void invalidate()
      Cancel all prior-generation handles on stop, disconnect, death, or session replacement.
    • pendingCount

      public int pendingCount()
    • droppedTerminalCount

      public long droppedTerminalCount()
      Overflow is observable; old terminal snapshots may be dropped, never changed into success.