Function

next-request

Prepares to accept a new downstream request.

By default, each sandbox accepts a single downstream request, passed in as an argument to the http-incoming.handle call. The next-request function enables a sandbox to accept additional downstream requests. next-request returns a pending-request, which can be passed to await-request to wait for the request to become available and return the request.

When using this function, be mindful of two considerations:

  • When a single sandbox accepts multiple requests, its state isn't automatically cleared between requests. Applications are therefore responsible for preventing sensitive data from leaking from one request to another.

  • There is no guarantee that a single sandbox will receive all requests from a given client or from a given location. When it is necessary to preserve state between multiple requests, store it outside of the sandbox.

next-request: func(options: next-request-options) -> result​<pending-request, error>;