Package dev.gmitch215.bytebox
package dev.gmitch215.bytebox
Worker entry points and the HTTP types a handler works in.
A Worker implements one interface per trigger it handles — Worker
for HTTP, Scheduled for a Cron Trigger, and so on. Implementing only
what you handle is what keeps an unhandled trigger out of the generated configuration and out of
the compiled binary.
Every handler looks synchronous and suspends underneath. A binding call returns a value rather than a future because the compiler rewrites a blocking call into a continuation the host resumes. There is no parallelism to go with it: Cloudflare Workers run one thread and do not provide the Web Worker API, so a Java thread here is a fiber on the host's queue.
- Since:
- 1.0.0
-
ClassDescriptionHandles a Durable Object alarm.Builds the platform types a handler returns, and reaches the platform functions that are not bindings.Consumer<T>Consumes messages from a Queue.The Cron Trigger that started a scheduled invocation.The bindings declared in the Wrangler configuration, addressed by their binding names.A binding that is present, waiting to be typed.The per-invocation context Cloudflare passes to every handler.What a generated entry point calls.HTTP headers.An incoming email message, which records what a handler did with it.Handles incoming email.What a
Mailhandler did with a message.Cloudflare'sForwardableEmailMessage.Message<T>One message from a Queue.MessageBatch<T>A batch of Queue messages delivered to aConsumer.Cloudflare'sMessageBatch.One message from a Queue, as JavaScript delivers it.An incoming HTTP request.An HTTP response, outgoing or received.Handles Cron Triggers.The controller Cloudflare passes to ascheduledhandler.Receives trace events from another Worker.One trace event delivered to aTailhandler.Handles HTTP requests.