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

    Function runFillWindow

    • Drives one warm window: connect, pump one message per fill, close.

      The driver has to live OUTSIDE the Durable Object, because the budget resets on an INCOMING message and an object cannot send itself one. The Worker's own cost is a relay -- it does no PHP and no rendering -- and its wall time is not charged.

      Bounded three ways, because a window spends three different budgets: maxFills bounds DO requests (100k/day) and rows written (100k/day), wallBudgetMs bounds billed duration (13,000 GB-s/day, and a held socket is non-hibernatable so it IS billed), and the 15-minute platform maximum on a connection keeping an object alive caps the rest.

      Parameters

      • env: FillWindowEnv
      • site: string
      • opts: { maxFills?: number; wallBudgetMs?: number } = {}

      Returns Promise<FillWindowResult | FillWindowFailure>

      the two cases are discriminated by ok, because a window that could not open has no outcomes rather than an empty list of them