public function pushBulk($jobs = [], $queue = self::QUEUE)
    {
        $ids = [];
        foreach ($jobs as $job) {
            if (!isset($job['class'])) {
                throw new Exception('pushBulk: each job needs a job class');
            }
            if (!isset($job['args']) || !is_array($job['args'])) {
                throw new Exception('pushBulk: each job needs args');
            }

            $retry = isset($job['retry']) ? $job['retry'] : true;
            $doAt = isset($job['at']) ? $job['at'] : null;

            $jobId = $this->idGenerator->generate();
            array_push($ids, $jobId);
            $this->atomicPush($jobId, $job['class'], $job['args'], $queue, $retry, $doAt);
        }

        return $ids;
    }
public function pushBulk($jobs = [], $queue = self::QUEUE)
    {
        $ids = [];
        foreach ($jobs as $job) {
            if (!isset($job['class'])) {
                throw new Exception('pushBulk: each job needs a job class');
            }
            if (!isset($job['args']) || !is_array($job['args'])) {
                throw new Exception('pushBulk: each job needs args');
            }

            $retry = isset($job['retry']) ? $job['retry'] : true;
            $doAt = isset($job['at']) ? $job['at'] : null;

            $jobId = $this->idGenerator->generate();
            array_push($ids, $jobId);
            $this->atomicPush($jobId, $job['class'], $job['args'], $queue, $retry, $doAt);
        }

        return $ids;
    }
public function pushBulk ( $ jobs = [ ] , $ queue = self :: QUEUE ) { $ ids = [ ] ; foreach ( $ jobs as $ job ) { if ( ! isset ( $ job [ 'class' ] ) ) { throw new Exception ( 'pushBulk: each job needs a job class' ) ; } if ( ! isset ( $ job [ 'args' ] ) || ! is_array ( $ job [ 'args' ] ) ) { throw new Exception ( 'pushBulk: each job needs args' ) ; } $ retry = isset ( $ job [ 'retry' ] ) ? $ job [ 'retry' ] : true ; $ doAt = isset ( $ job [ 'at' ] ) ? $ job [ 'at' ] : null ; $ jobId = $ this -> idGenerator -> generate ( ) ; array_push ( $ ids , $ jobId ) ; $ this -> atomicPush ( $ jobId , $ job [ 'class' ] , $ job [ 'args' ] , $ queue , $ retry , $ doAt ) ; } return $ ids ; }
Push multiple jobs to queue

Format:
$jobs = [
[
'class' => 'SomeClass',
'args' => array(),
'retry' => false,
'at' => microtime(true)
]
];

@param array  $jobs
@param string $queue
@return string
@throws exception Exception
Push multiple jobs to queue