Setu-TS
    Preparing search index...

    Function createQueueHandler

    • Builds the handler an application exports as queue.

      The queue is resolved from the application's registry rather than passed in, so the processors registered through IQueue.process anywhere in the application are the processors this handler dispatches into — there is only ever one instance.

      Resolution is lazy: the token is read on each invocation, not when this factory runs, so the export can be built before app.start() has registered anything.

      Parameters

      Returns QueueHandler

      The handler to assign to the Worker's queue export

      const app = createApplication({
      plugins: [RuntimePlugin({ env }), CloudflarePlugin({ env, queue: { binding: 'JOBS' } })],
      });
      await app.start();

      export default { fetch: app.fetch, queue: createQueueHandler(app) };

      At invocation time, when the resolved token holds an IQueue that is not a WorkersQueue — a memory or Redis queue has no batch to dispatch and would silently drop the delivery

      0.2.0