UNPKG

@cavai/adonis-queue

Version:
30 lines (29 loc) 1.23 kB
import { DateTime } from 'luxon'; import { BaseJob } from './base_job.js'; type DispatcherResult = { id: number | string; }; export declare class Dispatcher<T extends typeof BaseJob> implements Promise<DispatcherResult> { #private; then<TResult1 = DispatcherResult, TResult2 = never>(onfulfilled?: ((value: DispatcherResult) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>; catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<DispatcherResult | TResult>; finally(onfinally?: (() => void) | undefined | null): Promise<DispatcherResult>; /** * Required when Promises are extended */ get [Symbol.toStringTag](): string; constructor(job: T, data: ConstructorParameters<T>); /** * Execute promise, storing job to storage using defined driver */ exec(): Promise<{ id: number | string; }>; /** * Delay job execution until given time * * @param time Time after what job will be available for execution */ delay(time: DateTime): this; } export {};