You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
372 B

7 years ago
<?php
namespace core\jobs;
use yii\queue\JobInterface;
abstract class Job implements JobInterface
{
public function execute($queue): void
{
$listener = $this->resolveHandler();
$listener($this, $queue);
}
private function resolveHandler(): callable
{
return [\Yii::createObject(static::class . 'Handler'), 'handle'];
}
}