File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/laravel/framework/src/Illuminate/Events
Upload
[..]
CallQueuedListener.php (5.48 KB)
Edit
Rename
Del
Dispatcher.php (26.92 KB)
Edit
Rename
Del
InvokeQueuedClosure.php (876 B)
Edit
Rename
Del
LICENSE.md (1.05 KB)
Edit
Rename
Del
QueuedClosure.php (3.98 KB)
Edit
Rename
Del
composer.json (1.01 KB)
Edit
Rename
Del
functions.php (329 B)
Edit
Rename
Del
Edit: QueuedClosure.php
<?php namespace Illuminate\Events; use Closure; use Illuminate\Support\Collection; use Laravel\SerializableClosure\SerializableClosure; use function Illuminate\Support\enum_value; class QueuedClosure { /** * The underlying Closure. * * @var \Closure */ public $closure; /** * The name of the connection the job should be sent to. * * @var string|null */ public $connection; /** * The name of the queue the job should be sent to. * * @var string|null */ public $queue; /** * The job "group" the job should be sent to. * * @var string|null */ public $messageGroup; /** * The job deduplicator callback the job should use to generate the deduplication ID. * * @var \Laravel\SerializableClosure\SerializableClosure|null */ public $deduplicator; /** * The number of seconds before the job should be made available. * * @var \DateTimeInterface|\DateInterval|int|null */ public $delay; /** * All of the "catch" callbacks for the queued closure. * * @var array */ public $catchCallbacks = []; /** * Create a new queued closure event listener resolver. * * @param \Closure $closure */ public function __construct(Closure $closure) { $this->closure = $closure; } /** * Set the desired connection for the job. * * @param \UnitEnum|string|null $connection * @return $this */ public function onConnection($connection) { $this->connection = enum_value($connection); return $this; } /** * Set the desired queue for the job. * * @param \UnitEnum|string|null $queue * @return $this */ public function onQueue($queue) { $this->queue = enum_value($queue); return $this; } /** * Set the desired job "group". * * This feature is only supported by some queues, such as Amazon SQS. * * @param \UnitEnum|string $group * @return $this */ public function onGroup($group) { $this->messageGroup = enum_value($group); return $this; } /** * Set the desired job deduplicator callback. * * This feature is only supported by some queues, such as Amazon SQS FIFO. * * @param callable|null $deduplicator * @return $this */ public function withDeduplicator($deduplicator) { $this->deduplicator = $deduplicator instanceof Closure ? new SerializableClosure($deduplicator) : $deduplicator; return $this; } /** * Set the desired delay in seconds for the job. * * @param \DateTimeInterface|\DateInterval|int|null $delay * @return $this */ public function delay($delay) { $this->delay = $delay; return $this; } /** * Specify a callback that should be invoked if the queued listener job fails. * * @param \Closure $closure * @return $this */ public function catch(Closure $closure) { $this->catchCallbacks[] = $closure; return $this; } /** * Resolve the actual event listener callback. * * @return \Closure */ public function resolve() { return function (...$arguments) { dispatch(new CallQueuedListener(InvokeQueuedClosure::class, 'handle', [ 'closure' => new SerializableClosure($this->closure), 'arguments' => $arguments, 'catch' => (new Collection($this->catchCallbacks)) ->map(fn ($callback) => new SerializableClosure($callback)) ->all(), ])) ->onConnection($this->connection) ->onQueue($this->queue) ->delay($this->delay) ->onGroup($this->messageGroup) ->withDeduplicator($this->deduplicator); }; } }
Simpan