* - list all the jobs (with their payloads) in a queue between start index and stop index. * - jobs is an array containing the payload of the job enqueued
(q: string, start: number, stop: number)
| 353 | * - jobs is an array containing the payload of the job enqueued |
| 354 | */ |
| 355 | async queued(q: string, start: number, stop: number) { |
| 356 | const items = await this.connection.redis.lrange( |
| 357 | this.connection.key("queue", q), |
| 358 | start, |
| 359 | stop, |
| 360 | ); |
| 361 | const tasks = items.map(function (i) { |
| 362 | return JSON.parse(i); |
| 363 | }); |
| 364 | return tasks; |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * - jobsHash is an object with its keys being timestamps, and the values are arrays of jobs at each time. |