Two lines to set up
Name a producer and a consumer in lyrcloud.json, then await env.JOBS.send(body). No brokers, pollers or workers to run.
Send work from one function and process it in another: emails, webhooks, image resizing, imports. Retries with backoff, delayed jobs and a dead-letter list are built in, and a quiet queue costs nothing.
// lyrcloud.json:
// "queues": { "producers": { "JOBS": "emails" },
// "consumers": [{ "queue": "emails", "maxRetries": 3, "retryDelay": 30 }] }
export default {
async fetch(request, env) {
await env.JOBS.send({ to: 'ana@example.com', template: 'welcome' });
return new Response('Thanks for signing up!');
},
async queue(batch, env) {
for (const message of batch.messages) {
await sendEmail(message.body); // throw to retry later
}
},
};
// $ lyrcloud queues dead emails
// $ lyrcloud queues replay emails
Name a producer and a consumer in lyrcloud.json, then await env.JOBS.send(body). No brokers, pollers or workers to run.
Throw from queue(), or call message.retry(), and the message comes back later. Delays double each time.
Messages that fail every retry are kept for 14 days. Inspect them and replay them from the dashboard or lyrcloud queues replay.
send(body, { delaySeconds: 3600 }) runs work up to 12 hours later: reminders, follow-ups, cleanups.
Messages sent before a consumer exists, or while it is suspended, wait for it. Delivery is at least once.
lyrcloud dev runs your queue handler in-process, with the same retries.
Launch: 5 queues and 100k messages a month. Scale: 50 queues and 5M messages. Enterprise: 250 queues and 50M messages.
Register or transfer a domain with free WHOIS privacy and Lyrcloud DNS, paid by card or with Lyrpay.
Learn moreResponse caching, static files and whole static sites for your edge functions, with cache headers you control and purges from the CLI.
Learn moreRate limits, IP rules, a firewall for common attacks, bot checks and secure headers for your edge functions, set in lyrcloud.json and enforced before your code runs.
Learn moreCreate a free account in under a minute. No credit card required.