Package dev.gmitch215.bytebox
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 TypeMethodDescriptiongetProps()The Worker's own properties, when the invocation carries them.voidMarks the invocation so an uncaught exception does not retry it.default voidKeeps the invocation alive until a future completes.default voidwaitUntil(org.teavm.jso.core.JSPromise<?> work) Keeps the invocation alive until a promise settles.voidwaitUntil(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
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
fetchis 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
-