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.
41 lines
882 B
41 lines
882 B
<?php
|
|
|
|
namespace App\Utilities\Jobs;
|
|
|
|
use App\Jobs\Job;
|
|
|
|
class AsyncCall extends Job
|
|
{
|
|
private string $method;
|
|
private string $service;
|
|
private string $path;
|
|
private array $data;
|
|
|
|
/**
|
|
* AsyncCall constructor.
|
|
* @param string $method
|
|
* @param string $service
|
|
* @param string $path
|
|
* @param array $data
|
|
* @param string $queue
|
|
*/
|
|
public function __construct(string $method, string $service, string $path, array $data, string $queue)
|
|
{
|
|
$this->method = $method;
|
|
$this->service = $service;
|
|
$this->path = $path;
|
|
$this->data = $data;
|
|
$this->onQueue($queue);
|
|
$this->onConnection('database');
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
call($this->method, $this->service, $this->path, $this->data);
|
|
}
|
|
}
|