* Get jobs with raw hash data by type/state. * * @param array $types * @param int $start * @param int $end * @param bool $asc * @return array Raw per-type job arrays returned by Redis */
(array $types, int $start = 0, int $end = -1, bool $asc = false)
| 363 | * @return array<mixed> Raw per-type job arrays returned by Redis |
| 364 | */ |
| 365 | public function getJobs(array $types, int $start = 0, int $end = -1, bool $asc = false): array |
| 366 | { |
| 367 | $transformedTypes = array_map( |
| 368 | fn($type) => $type === 'waiting' ? 'wait' : $type, |
| 369 | $types |
| 370 | ); |
| 371 | |
| 372 | $keys = $this->getKeys(['']); |
| 373 | $args = [ |
| 374 | $start, |
| 375 | $end, |
| 376 | $asc ? '1' : '0', |
| 377 | self::GET_JOBS_MAX_BACKFILL_ITERATIONS, |
| 378 | ...$transformedTypes, |
| 379 | ]; |
| 380 | |
| 381 | $result = $this->execScript('getJobs-1.lua', $keys, $args); |
| 382 | |
| 383 | return is_array($result) ? $result : []; |
| 384 | } |
| 385 | |
| 386 | /** |
| 387 | * Get ranges of jobs. |
nothing calls this directly
no test coverage detected