public function reschedule(Job $job, \DateTime $date, $priority = PheanstalkInterface::DEFAULT_PRIORITY)
    {
        if ($date < new \DateTime()) {
            throw new \InvalidArgumentException(
                sprintf('You cannot reschedule a job in the past (got %s, and the current date is %s)', $date->format(DATE_ISO8601), date(DATE_ISO8601))
            );
        }

        $this->pheanstalk->release($job, $priority, $date->getTimestamp() - time());

        $this->logJob($job->getId(), sprintf('Rescheduled job for %s', $date->format('Y-m-d H:i:s')));
    }
public function reschedule(Job $job, \DateTime $date, $priority = PheanstalkInterface::DEFAULT_PRIORITY)
    {
        if ($date < new \DateTime()) {
            throw new \InvalidArgumentException(
                sprintf('You cannot reschedule a job in the past (got %s, and the current date is %s)', $date->format(DATE_ISO8601), date(DATE_ISO8601))
            );
        }

        $this->pheanstalk->release($job, $priority, $date->getTimestamp() - time());

        $this->logJob($job->getId(), sprintf('Rescheduled job for %s', $date->format('Y-m-d H:i:s')));
    }
public function reschedule ( Job $ job , \ DateTime $ date , $ priority = PheanstalkInterface :: DEFAULT_PRIORITY ) { if ( $ date < new \ DateTime ( ) ) { throw new \ InvalidArgumentException ( sprintf ( 'You cannot reschedule a job in the past (got %s, and the current date is %s)' , $ date -> format ( DATE_ISO8601 ) , date ( DATE_ISO8601 ) ) ) ; } $ this -> pheanstalk -> release ( $ job , $ priority , $ date -> getTimestamp ( ) - time ( ) ) ; $ this -> logJob ( $ job -> getId ( ) , sprintf ( 'Rescheduled job for %s' , $ date -> format ( 'Y-m-d H:i:s' ) ) ) ; }
Reschedules a job.

@param Job       $job
@param \DateTime $date
@param integer   $priority

@throws \InvalidArgumentException When `$date` is in the past
Reschedules a job .