function it_releases_job_onto_rabbitmq(AMQPChannel $channel, RabbitMQQueue $queue)
 {
     // delete
     $channel->basic_ack('fooTagId')->shouldBeCalled();
     // release with attempts added into body
     $queue->later(1, 'foo', [0 => "someData", "attempts" => 1], 'default')->shouldBeCalled();
     $this->release(1);
 }
 /**
  * Release the job back into the queue.
  *
  * @param int $delay
  */
 public function release($delay = 0)
 {
     $this->delete();
     $body = $this->getBody();
     $attempts = $this->attempts();
     // write attempts to body
     $body['data']['attempts'] = $attempts + 1;
     $job = $body['job'];
     $data = $body['data'];
     if ($delay > 0) {
         $this->rabbit->later($delay, $job, $data, $this->getQueue());
     } else {
         $this->rabbit->push($job, $data, $this->getQueue());
     }
 }