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

    Variable default

    default: {
        fetch(
            request: Request,
            env: SiteWorkerEnv,
            ctx?: ExecutionContext<unknown>,
        ): Promise<Response>;
        scheduled(
            event: ScheduledController,
            env: SiteWorkerEnv,
            ctx: ExecutionContext,
        ): Promise<void>;
    }

    Thin front end for the site Durable Object, plus the edge cache in front of it.

    It runs no PHP: ctx.storage.sql is synchronous only inside the object and PDO blocks. A caches.default hit costs no Durable Object request or wall-clock and is the only layer that scales across colos. Public routes are never gated; diagnostic routes fail closed without PW_DIAGNOSTICS, since a profiling route can permanently degrade its isolate.

    Type Declaration

    • fetch: function
      • Parameters

        • request: Request
        • env: SiteWorkerEnv
        • Optionalctx: ExecutionContext<unknown>

        Returns Promise<Response>

    • scheduled: function
      • Cron entry point for the warm window (it amortises one boot across a queue drain). The site set comes from cfw_fleet, since a cron has no hostname; see warmTargets.

        Parameters

        • event: ScheduledController
        • env: SiteWorkerEnv
        • ctx: ExecutionContext

        Returns Promise<void>