pixelfed/app/Jobs/InboxPipeline/InboxWorker.php

46 lines
973 B
PHP
Raw Normal View History

2018-07-23 17:31:51 +00:00
<?php
namespace App\Jobs\InboxPipeline;
use App\Profile;
use App\Util\ActivityPub\Inbox;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
2018-08-28 03:07:36 +00:00
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
2018-07-23 17:31:51 +00:00
class InboxWorker implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
2018-11-04 03:53:46 +00:00
protected $headers;
2018-07-23 17:31:51 +00:00
protected $profile;
protected $payload;
2019-08-28 01:14:56 +00:00
public $timeout = 5;
public $tries = 1;
2018-07-23 17:31:51 +00:00
/**
* Create a new job instance.
*
* @return void
*/
2018-11-04 03:53:46 +00:00
public function __construct($headers, $profile, $payload)
2018-07-23 17:31:51 +00:00
{
2018-11-04 03:53:46 +00:00
$this->headers = $headers;
2018-07-23 17:31:51 +00:00
$this->profile = $profile;
$this->payload = $payload;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
2018-11-04 03:53:46 +00:00
(new Inbox($this->headers, $this->profile, $this->payload))->handle();
2018-07-23 17:31:51 +00:00
}
}