mirror of
https://github.com/idanoo/laravel-resque.git
synced 2024-11-22 00:21:58 +00:00
63 lines
852 B
PHP
63 lines
852 B
PHP
<?php
|
|
namespace Hlgrrnhrdt\Resque;
|
|
|
|
/**
|
|
* Job
|
|
*
|
|
* @author Holger Reinhardt <hlgrrnhrdt@gmail.com>
|
|
*/
|
|
abstract class Job
|
|
{
|
|
/**
|
|
* @var \Resque_Job
|
|
*/
|
|
public $job;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
public $queue = 'default';
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
public $args = [];
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function queue()
|
|
{
|
|
return $this->queue;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function arguments()
|
|
{
|
|
return $this->args;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function name()
|
|
{
|
|
return \get_class($this);
|
|
}
|
|
|
|
/**
|
|
* @param string $queue
|
|
*
|
|
* @return Job
|
|
*/
|
|
public function onQueue($queue)
|
|
{
|
|
$this->queue = $queue;
|
|
return $this;
|
|
}
|
|
|
|
abstract public function perform();
|
|
}
|