Are queue consumers going to be using the new "standard" worker pricing model in the future? Or at l
Are queue consumers going to be using the new "standard" worker pricing model in the future? Or at least, have the option to not be unbound?
A batch can contain up to 100 messages, though items are limited to 128 KB each, and the total size of the array cannot exceed 256 KB.https://developers.cloudflare.com/queues/platform/javascript-apis/#queue
waitUntil unless you are actively loggingcsv-parse, maybe the internal Buffer is not flushing correctly.max_batch_size and max_batch_timeout on the queue?ackAll() ? waitUntil [ERROR] Error: Worker exceeded memory limit.csv-parsemax_batch_sizemax_batch_timeoutackAll()export async fetch(request: Request, env: Environment, ctx: ExecutionContext) {
const response = await fetch(someUrl);
const objectsStream = response.body!.getReader()
.pipeThrough(new TextDecoderStream())
.pipeThrough(new CSVParserStream());
const enqueue = async () => {
for await (const objects of take(100, objectsStream)) {
await env.MY_QUEUE.sendBatch(objects.map(object => ({
body: object,
contentType: "json",
})));
}
};
ctx.waitUntil(
enqueue()
.then(() => {
console.log("Success");
})
.catch(console.error)
);
return new Response("OK");
}