Options
All
  • Public
  • Public/Protected
  • All
Menu

A Fastly C@E specific implementation of FetchEvent.

Hierarchy

  • FetchEvent

Index

Properties

Methods

Properties

Readonly client

client: ClientInfo

Information about the downstream client that made the request

Readonly request

request: Request

The downstream request that came from the client

Methods

respondWith

  • Send a response back to the client.

    Note: The service will be kept alive until the response has been fully sent.

    If the response contains a streaming body created by the service itself, then the service will be kept alive until the body ReadableStream has been closed or errored.

    However, if the body is a stream originating in a request to a backend, i.e. if a backend response's Response.body is passed as input to the Response constructor, the service will not be kept alive until sending the body has finished.

    Note: If response is a Promise, the service will be kept alive until the response has been resolved or rejected, and the Response it resolved to has been fully sent.

    Note: Use FetchEvent.waitUntil to extend the service's lifetime further if necessary.

    Parameters

    • response: Response | Promise<Response>

      Response to send back down to the client

    Returns void

waitUntil

  • waitUntil(promise: Promise<any>): void
  • Extend the service's lifetime to ensure asynchronous operations succeed.

    By default, a service will shut down as soon as the response passed to respondWith has been sent. waitUntil can be used to ensure that the service will stay alive until additional asynchronous operations have completed, such as sending telemetry data to a separate backend after the response has been sent.

    Parameters

    • promise: Promise<any>

      The Promise to wait for

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method

Generated using TypeDoc