Class default<Job, Result>
Constructors
constructor
- new default<Job, Result>(): default<Job, Result>
Type parameters
Returns default<Job, Result>
Properties
currentSeq
currentSeq: number
Methods
acquire
- acquire(count: number, consume: (jobs: Job[]) => Promise<JobResponse<Job, Result>[]>): Promise<undefined | JobResponse<Job, Result>[]>
Parameters
count: number
consume: (jobs: Job[]) => Promise<JobResponse<Job, Result>[]>
Returns Promise<undefined | JobResponse<Job, Result>[]>
acquireAt
- acquireAt(idx: number, count: number, consume: ConsumeJobsFn<Job, Result>): Promise<undefined | JobResponse<Job, Result>[]>
Parameters
idx: number
count: number
consume: ConsumeJobsFn<Job, Result>
Returns Promise<undefined | JobResponse<Job, Result>[]>
onJobs
- onJobs(listener: (queue: default<Job, Result>) => void): void
Parameters
listener: (queue: default<Job, Result>) => void
- (queue: default<Job, Result>): void
Returns void
peekAt
- peekAt(idx: number): undefined | Job
Parameters
Returns undefined | Job
removeJobsListener
- removeJobsListener(listenerToRemove: (queue: default<Job, Result>) => void): boolean
Parameters
listenerToRemove: (queue: default<Job, Result>) => void
- (queue: default<Job, Result>): void
Returns boolean