laravel-resque/src/Job.php

55 lines
741 B
PHP
Raw Normal View History

2016-07-28 21:52:05 +00:00
<?php
namespace Hlgrrnhrdt\Resque;
/**
* Job
*
* @author Holger Reinhardt <hlgrrnhrdt@gmail.com>
*/
abstract class Job
{
2016-07-29 07:17:13 +00:00
/**
* @var \Resque_Job
*/
public $job;
2016-07-28 21:52:05 +00:00
/**
* @var string
*/
2016-07-29 07:17:13 +00:00
public $queue = 'default';
2016-07-28 21:52:05 +00:00
/**
* @var array
*/
2016-07-29 07:17:13 +00:00
public $args = [];
2016-07-28 21:52:05 +00:00
/**
* @return mixed
*/
public function queue()
{
return $this->queue;
}
/**
* @return array
*/
public function arguments()
{
2016-07-29 07:17:13 +00:00
return $this->$args;
2016-07-28 21:52:05 +00:00
}
/**
* @param string $queue
*
* @return Job
*/
public function onQueue($queue)
{
$this->queue = $queue;
return $this;
}
2016-07-29 07:17:13 +00:00
abstract public function perform();
2016-07-28 21:52:05 +00:00
}