src/Jobs/Collection.php
public function fromWorker(string $worker, string $subTimeInterval = ''): array
    {
        try {
            $now = new \DateTime();
            $interval = date_interval_create_from_date_string($subTimeInterval);
            $timestamp = $now->sub($interval)->getTimestamp();
        } catch (\Exception $e) {
            $timestamp = -1;
        }

        if ($subTimeInterval === '' || $timestamp === -1) {
            $jids = json_decode($this->client->workerJobs($worker), true) ?: [];
        } else {
            $jids = json_decode($this->client->workerJobs($worker, $timestamp), true) ?: [];
        }

        return $this->multiget($jids);
    }
public function fromWorker(string $worker, string $subTimeInterval = ''): array
    {
        try {
            $now = new \DateTime();
            $interval = date_interval_create_from_date_string($subTimeInterval);
            $timestamp = $now->sub($interval)->getTimestamp();
        } catch (\Exception $e) {
            $timestamp = -1;
        }

        if ($subTimeInterval === '' || $timestamp === -1) {
            $jids = json_decode($this->client->workerJobs($worker), true) ?: [];
        } else {
            $jids = json_decode($this->client->workerJobs($worker, $timestamp), true) ?: [];
        }

        return $this->multiget($jids);
    }
public function fromWorker ( string $ worker , string $ subTimeInterval = '' ) : array { try { $ now = new \ DateTime ( ) ; $ interval = date_interval_create_from_date_string ( $ subTimeInterval ) ; $ timestamp = $ now -> sub ( $ interval ) -> getTimestamp ( ) ; } catch ( \ Exception $ e ) { $ timestamp = - 1 ; } if ( $ subTimeInterval === '' || $ timestamp === - 1 ) { $ jids = json_decode ( $ this -> client -> workerJobs ( $ worker ) , true ) ? : [ ] ; } else { $ jids = json_decode ( $ this -> client -> workerJobs ( $ worker , $ timestamp ) , true ) ? : [ ] ; } return $ this -> multiget ( $ jids ) ; }
Reads jobs in a worker.

@param string $worker
@param string $subTimeInterval  specify last time interval, i.e. '2 hours', '15 mins' and etc; all jobs on empty
@return array  BaseJob[]
Reads jobs in a worker .