pixelfed/app/Jobs/InboxPipeline/InboxWorker.php

43 lines
924 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;
/**
* 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
}
}