Setu-TS
    Preparing search index...

    Interface IQueue

    Background job queue.

    const queue = ctx.services.get<IQueue>(CAPABILITIES.QUEUE);
    await queue.add('send-email', { to: user.email, template: 'welcome' });
    queue.process<SendEmailJob>('send-email', async (job) => {
    await mailer.send(job.data);
    }, { concurrency: 3 });

    0.1.0

    interface IQueue {
        add<T>(name: string, data: T, options?: AddJobOptions): Promise<string>;
        addRecurring<T>(
            name: string,
            data: T,
            options: RecurringOptions,
        ): Promise<void>;
        process<T>(
            name: string,
            processor: JobProcessor<T>,
            options?: ProcessOptions,
        ): void;
    }

    Implemented by

    Index