for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Canvas\Jobs;
use Canvas\Contracts\Queue\QueueableJobInterface;
use Canvas\Queue\Queue;
use Phalcon\Di;
class PendingDispatch
{
/**
* The job.
*
* @var mixed
*/
protected $job;
* Create a new pending job dispatch.
* @param QueueableJobInterface $job
* @return void
public function __construct(QueueableJobInterface $job)
$this->job = $job;
}
* Set the desired queue for the job.
* @param string $queue
* @return $this
public function onQueue(string $queue)
$this->job->onQueue($queue);
return $this;
* Handle the object's destruction.
public function __destruct()
$jobData = [
'userData' => Di::getDefault()->getUserData(),
'class' => get_class($this->job),
'job' => $this->job
];
return Queue::send($this->job->queue, serialize($jobData));
return Canvas\Queue\Queu...e, serialize($jobData))
true
void