Events
Events call a handler inside the deployment. Use them when the caller does not need an immediate result.
Queue message ─┐
Storage event ─┼──> handler in your Worker
Schedule ──────┘import {
onCronEvent,
onQueueMessage,
onStorageEvent,
} from "@alienplatform/sdk"
onQueueMessage("jobs", async message => {
// Queue delivery is at least once. Make this handler idempotent.
})
onStorageEvent("uploads", async event => {
// React to an object change in this deployment.
})
onCronEvent("nightly", async () => {
// Run scheduled work.
})The handler uses the same bindings as other code in the Worker. Queue delivery is at least once, so processing must tolerate retries and duplicate messages.
Continue with Worker events and triggers, Queue, or Storage.