public function getAvailableJobs($queue, $max = 10) {
        $qb = $this->conn->createQueryBuilder();
        $qb->select('*');
        $qb->from($this->table_name);
        $qb->where('status = :status AND queue = :queue AND available_at <= :now');
        $qb->orderBy('status');
        $qb->setParameters([
            'status' => self::JOB_STATUS_CREATED,
            'queue' => $queue,
        ]);
        $qb->setParameter('now', new \DateTime(), Type::DATETIME);
        $qb->setMaxResults($max);
        $stmt = $qb->execute();
        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
    }
public function getAvailableJobs($queue, $max = 10) {
        $qb = $this->conn->createQueryBuilder();
        $qb->select('*');
        $qb->from($this->table_name);
        $qb->where('status = :status AND queue = :queue AND available_at <= :now');
        $qb->orderBy('status');
        $qb->setParameters([
            'status' => self::JOB_STATUS_CREATED,
            'queue' => $queue,
        ]);
        $qb->setParameter('now', new \DateTime(), Type::DATETIME);
        $qb->setMaxResults($max);
        $stmt = $qb->execute();
        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
    }
public function getAvailableJobs ( $ queue , $ max = 10 ) { $ qb = $ this -> conn -> createQueryBuilder ( ) ; $ qb -> select ( '*' ) ; $ qb -> from ( $ this -> table_name ) ; $ qb -> where ( 'status = :status AND queue = :queue AND available_at <= :now' ) ; $ qb -> orderBy ( 'status' ) ; $ qb -> setParameters ( [ 'status' => self :: JOB_STATUS_CREATED , 'queue' => $ queue , ] ) ; $ qb -> setParameter ( 'now' , new \ DateTime ( ) , Type :: DATETIME ) ; $ qb -> setMaxResults ( $ max ) ; $ stmt = $ qb -> execute ( ) ; return $ stmt -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; }
get available jobs
get available jobs