mycocepurus-smithii - v2.0.1
    Preparing search index...

    Type Alias Entry<T>

    Entry:
        | {
            claimedAt: number;
            fingerprint: string;
            leaseFor: number;
            owner: string;
            state: "in-flight";
        }
        | {
            fingerprint: string;
            retainFor: number;
            state: "complete";
            storedAt: number;
            value: T;
        }

    What a store holds under one key.

    The fingerprint travels with the entry so that a hit can be checked against the request in hand, and the window travels with it so that expiry is re-checked on the way out rather than trusted to the store. Every number is milliseconds from the clock of whoever wrote the entry.

    Type Parameters

    • T

    Type Declaration

    • {
          claimedAt: number;
          fingerprint: string;
          leaseFor: number;
          owner: string;
          state: "in-flight";
      }
      • claimedAt: number

        When the claim was taken.

      • fingerprint: string
      • leaseFor: number

        How long past claimedAt the claim is honoured before the attempt is presumed dead.

      • owner: string

        Random per attempt. complete and release act only while the claim under the key still carries it, so an attempt that outlived its lease cannot touch the claim of the attempt that replaced it.

      • state: "in-flight"
    • {
          fingerprint: string;
          retainFor: number;
          state: "complete";
          storedAt: number;
          value: T;
      }
      • fingerprint: string
      • retainFor: number

        How long past storedAt the value is replayed.

      • state: "complete"
      • storedAt: number

        When the action finished.

      • value: T