Interface ExecutionCtx

All Superinterfaces:
org.teavm.jso.JSObject

public interface ExecutionCtx extends org.teavm.jso.JSObject
The per-invocation context Cloudflare passes to every handler.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    The Worker's own properties, when the invocation carries them.
    void
    Marks the invocation so an uncaught exception does not retry it.
    default void
    waitUntil(Future<?> work)
    Keeps the invocation alive until a future completes.
    default void
    waitUntil(org.teavm.jso.core.JSPromise<?> work)
    Keeps the invocation alive until a promise settles.
    void
    waitUntil(org.teavm.jso.JSObject work)
    Keeps the invocation alive until the given work finishes.

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • waitUntil

      void waitUntil(org.teavm.jso.JSObject work)
      Keeps the invocation alive until the given work finishes.

      Work still running when a handler returns is cancelled. That includes a fiber nobody joined and a fetch nobody awaited, which is what makes this the difference between logging that happens and logging that silently does not.

      Parameters:
      work - the work to wait for
    • waitUntil

      default void waitUntil(Future<?> work)
      Keeps the invocation alive until a future completes.
      Parameters:
      work - the work to wait for
    • waitUntil

      default void waitUntil(org.teavm.jso.core.JSPromise<?> work)
      Keeps the invocation alive until a promise settles.
      Parameters:
      work - the work to wait for
    • passThroughOnException

      void passThroughOnException()
      Marks the invocation so an uncaught exception does not retry it.

      Only meaningful where the platform retries: a queue consumer and a Durable Object alarm. A fetch is never retried, so calling this there does nothing.

    • getProps

      TSObject getProps()
      The Worker's own properties, when the invocation carries them.

      Set by a dispatch namespace when one Worker invokes another, and absent otherwise.

      Returns:
      the properties, or null