drupflare/worker - v1.0.0
    Preparing search index...

    Function deferredStatus

    • Decides the state from what the tables hold.

      Pure, so the whole state machine is testable without a Durable Object, an alarm or a socket -- which matters because the interesting cases are the ones that are awkward to reach live: an entry that expired between the queue and the read, and a queue row whose budget is spent.

      Parameters

      • entry: CacheEntry | null
      • queued: QueueRow | null
      • nowMs: number
      • alarmDelayMs: number = 1

        how soon the alarm will run again; the drain re-arms at +1 ms while the queue is non-empty

      Returns DeferredStatus