If one worker is the consumer of multiple queues, is concurrency per queue or global?
If one worker is the consumer of multiple queues, is concurrency per queue or global?
Environment is available to a queue handler as an arg, and so Environment.<YOUR_ENV_VAR> will exist.Environment for every handler, you can type the export default object literalfetch to be limited to a few colos for example, but totally fine if queue is.EnvironmentEnvironmentqueuequeueEnvironment.<YOUR_ENV_VAR>interface Environment {
TOP_SECRET: string
}
interface Message {
MY_EPIC_QUEUE_MESSAGE_INTERFACE_OR_WHATEVER: string
}
export default <ExportedHandler<Environment, Message>> {
async fetch(req, env, ctx) {
return new Response();
},
async queue(msg, env, ctx) {
// do stuff
}
}