DirectDeliverPipeline.php 985 B

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