コード例 #1
0
ファイル: Dequeuer.php プロジェクト: lightster/hodor
 /**
  * @param string $status
  * @param array $meta
  * @throws BufferedJobNotFoundException
  */
 private function markJobAsFinished($status, array $meta)
 {
     if (!$this->database->has('queued_jobs', $meta['buffered_job_id'])) {
         throw new BufferedJobNotFoundException("", $meta['buffered_job_id'], $meta);
     }
     $row = $this->database->delete('queued_jobs', $meta['buffered_job_id']);
     $this->database->insert("{$status}_jobs", $meta['buffered_job_id'], $row);
 }
コード例 #2
0
ファイル: Superqueuer.php プロジェクト: lightster/hodor
 public function publishBatch()
 {
     $this->in_batch = false;
     foreach ($this->batched_jobs as $job) {
         $job['queued_job_id'] = uniqid();
         $this->database->delete('buffered_jobs', $job['buffered_job_id']);
         $this->database->insert('queued_jobs', $job['buffered_job_id'], $job);
     }
     $this->batched_jobs = [];
 }
コード例 #3
0
ファイル: DatabaseTest.php プロジェクト: lightster/hodor
 /**
  * @covers ::delete
  * @expectedException Exception
  */
 public function testAnExceptionIsThrownIfANonExistentRowIsDeleted()
 {
     $this->database->delete('buffered_jobs', 1);
 }