InboxWorker.php 973 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Jobs\InboxPipeline;
  3. use App\Profile;
  4. use App\Util\ActivityPub\Inbox;
  5. use Illuminate\Bus\Queueable;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Foundation\Bus\Dispatchable;
  8. use Illuminate\Queue\InteractsWithQueue;
  9. use Illuminate\Queue\SerializesModels;
  10. class InboxWorker implements ShouldQueue
  11. {
  12. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  13. protected $headers;
  14. protected $profile;
  15. protected $payload;
  16. public $timeout = 5;
  17. public $tries = 1;
  18. /**
  19. * Create a new job instance.
  20. *
  21. * @return void
  22. */
  23. public function __construct($headers, $profile, $payload)
  24. {
  25. $this->headers = $headers;
  26. $this->profile = $profile;
  27. $this->payload = $payload;
  28. }
  29. /**
  30. * Execute the job.
  31. *
  32. * @return void
  33. */
  34. public function handle()
  35. {
  36. (new Inbox($this->headers, $this->profile, $this->payload))->handle();
  37. }
  38. }