MCPcopy Create free account
hub / github.com/taskforcesh/bullmq / getJobs

Method getJobs

php/src/Scripts.php:365–384  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

getKeysMethod · 0.95
execScriptMethod · 0.95

Tested by

no test coverage detected