update
This commit is contained in:
45
projects/priceservice/vendor/symfony/messenger/Event/AbstractWorkerMessageEvent.php
vendored
Normal file
45
projects/priceservice/vendor/symfony/messenger/Event/AbstractWorkerMessageEvent.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
use Symfony\Component\Messenger\Envelope;
|
||||
use Symfony\Component\Messenger\Stamp\StampInterface;
|
||||
|
||||
abstract class AbstractWorkerMessageEvent
|
||||
{
|
||||
private Envelope $envelope;
|
||||
private string $receiverName;
|
||||
|
||||
public function __construct(Envelope $envelope, string $receiverName)
|
||||
{
|
||||
$this->envelope = $envelope;
|
||||
$this->receiverName = $receiverName;
|
||||
}
|
||||
|
||||
public function getEnvelope(): Envelope
|
||||
{
|
||||
return $this->envelope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a unique identifier for transport receiver this message was received from.
|
||||
*/
|
||||
public function getReceiverName(): string
|
||||
{
|
||||
return $this->receiverName;
|
||||
}
|
||||
|
||||
public function addStamps(StampInterface ...$stamps): void
|
||||
{
|
||||
$this->envelope = $this->envelope->with(...$stamps);
|
||||
}
|
||||
}
|
||||
57
projects/priceservice/vendor/symfony/messenger/Event/SendMessageToTransportsEvent.php
vendored
Normal file
57
projects/priceservice/vendor/symfony/messenger/Event/SendMessageToTransportsEvent.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
use Symfony\Component\Messenger\Envelope;
|
||||
use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
|
||||
|
||||
/**
|
||||
* Event is dispatched before a message is sent to the transport.
|
||||
*
|
||||
* The event is *only* dispatched if the message will actually
|
||||
* be sent to at least one transport. If the message is sent
|
||||
* to multiple transports, the message is dispatched only once.
|
||||
* This message is only dispatched the first time a message
|
||||
* is sent to a transport, not also if it is retried.
|
||||
*
|
||||
* @author Ryan Weaver <ryan@symfonycasts.com>
|
||||
*/
|
||||
final class SendMessageToTransportsEvent
|
||||
{
|
||||
private Envelope $envelope;
|
||||
|
||||
private array $senders;
|
||||
|
||||
public function __construct(Envelope $envelope, array $senders)
|
||||
{
|
||||
$this->envelope = $envelope;
|
||||
$this->senders = $senders;
|
||||
}
|
||||
|
||||
public function getEnvelope(): Envelope
|
||||
{
|
||||
return $this->envelope;
|
||||
}
|
||||
|
||||
public function setEnvelope(Envelope $envelope): void
|
||||
{
|
||||
$this->envelope = $envelope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, SenderInterface>
|
||||
*/
|
||||
public function getSenders(): array
|
||||
{
|
||||
return $this->senders;
|
||||
}
|
||||
}
|
||||
47
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageFailedEvent.php
vendored
Normal file
47
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageFailedEvent.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
use Symfony\Component\Messenger\Envelope;
|
||||
|
||||
/**
|
||||
* Dispatched when a message was received from a transport and handling failed.
|
||||
*
|
||||
* The event name is the class name.
|
||||
*/
|
||||
final class WorkerMessageFailedEvent extends AbstractWorkerMessageEvent
|
||||
{
|
||||
private \Throwable $throwable;
|
||||
private bool $willRetry = false;
|
||||
|
||||
public function __construct(Envelope $envelope, string $receiverName, \Throwable $error)
|
||||
{
|
||||
$this->throwable = $error;
|
||||
|
||||
parent::__construct($envelope, $receiverName);
|
||||
}
|
||||
|
||||
public function getThrowable(): \Throwable
|
||||
{
|
||||
return $this->throwable;
|
||||
}
|
||||
|
||||
public function willRetry(): bool
|
||||
{
|
||||
return $this->willRetry;
|
||||
}
|
||||
|
||||
public function setForRetry(): void
|
||||
{
|
||||
$this->willRetry = true;
|
||||
}
|
||||
}
|
||||
21
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageHandledEvent.php
vendored
Normal file
21
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageHandledEvent.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
/**
|
||||
* Dispatched after a message was received from a transport and successfully handled.
|
||||
*
|
||||
* The event name is the class name.
|
||||
*/
|
||||
final class WorkerMessageHandledEvent extends AbstractWorkerMessageEvent
|
||||
{
|
||||
}
|
||||
31
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageReceivedEvent.php
vendored
Normal file
31
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageReceivedEvent.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
/**
|
||||
* Dispatched when a message was received from a transport but before sent to the bus.
|
||||
*
|
||||
* The event name is the class name.
|
||||
*/
|
||||
final class WorkerMessageReceivedEvent extends AbstractWorkerMessageEvent
|
||||
{
|
||||
private bool $shouldHandle = true;
|
||||
|
||||
public function shouldHandle(?bool $shouldHandle = null): bool
|
||||
{
|
||||
if (null !== $shouldHandle) {
|
||||
$this->shouldHandle = $shouldHandle;
|
||||
}
|
||||
|
||||
return $this->shouldHandle;
|
||||
}
|
||||
}
|
||||
21
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageRetriedEvent.php
vendored
Normal file
21
projects/priceservice/vendor/symfony/messenger/Event/WorkerMessageRetriedEvent.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
/**
|
||||
* Dispatched after a message has been sent for retry.
|
||||
*
|
||||
* The event name is the class name.
|
||||
*/
|
||||
final class WorkerMessageRetriedEvent extends AbstractWorkerMessageEvent
|
||||
{
|
||||
}
|
||||
37
projects/priceservice/vendor/symfony/messenger/Event/WorkerRateLimitedEvent.php
vendored
Normal file
37
projects/priceservice/vendor/symfony/messenger/Event/WorkerRateLimitedEvent.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
use Symfony\Component\RateLimiter\LimiterInterface;
|
||||
|
||||
/**
|
||||
* Dispatched after the worker has been blocked due to a configured rate limiter.
|
||||
* Can be used to reset the rate limiter.
|
||||
*
|
||||
* @author Bob van de Vijver
|
||||
*/
|
||||
final class WorkerRateLimitedEvent
|
||||
{
|
||||
public function __construct(private LimiterInterface $limiter, private string $transportName)
|
||||
{
|
||||
}
|
||||
|
||||
public function getLimiter(): LimiterInterface
|
||||
{
|
||||
return $this->limiter;
|
||||
}
|
||||
|
||||
public function getTransportName(): string
|
||||
{
|
||||
return $this->transportName;
|
||||
}
|
||||
}
|
||||
44
projects/priceservice/vendor/symfony/messenger/Event/WorkerRunningEvent.php
vendored
Normal file
44
projects/priceservice/vendor/symfony/messenger/Event/WorkerRunningEvent.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
use Symfony\Component\Messenger\Worker;
|
||||
|
||||
/**
|
||||
* Dispatched after the worker processed a message or didn't receive a message at all.
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
final class WorkerRunningEvent
|
||||
{
|
||||
private Worker $worker;
|
||||
private bool $isWorkerIdle;
|
||||
|
||||
public function __construct(Worker $worker, bool $isWorkerIdle)
|
||||
{
|
||||
$this->worker = $worker;
|
||||
$this->isWorkerIdle = $isWorkerIdle;
|
||||
}
|
||||
|
||||
public function getWorker(): Worker
|
||||
{
|
||||
return $this->worker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when no message has been received by the worker.
|
||||
*/
|
||||
public function isWorkerIdle(): bool
|
||||
{
|
||||
return $this->isWorkerIdle;
|
||||
}
|
||||
}
|
||||
34
projects/priceservice/vendor/symfony/messenger/Event/WorkerStartedEvent.php
vendored
Normal file
34
projects/priceservice/vendor/symfony/messenger/Event/WorkerStartedEvent.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
use Symfony\Component\Messenger\Worker;
|
||||
|
||||
/**
|
||||
* Dispatched when a worker has been started.
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
final class WorkerStartedEvent
|
||||
{
|
||||
private Worker $worker;
|
||||
|
||||
public function __construct(Worker $worker)
|
||||
{
|
||||
$this->worker = $worker;
|
||||
}
|
||||
|
||||
public function getWorker(): Worker
|
||||
{
|
||||
return $this->worker;
|
||||
}
|
||||
}
|
||||
34
projects/priceservice/vendor/symfony/messenger/Event/WorkerStoppedEvent.php
vendored
Normal file
34
projects/priceservice/vendor/symfony/messenger/Event/WorkerStoppedEvent.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Messenger\Event;
|
||||
|
||||
use Symfony\Component\Messenger\Worker;
|
||||
|
||||
/**
|
||||
* Dispatched when a worker has been stopped.
|
||||
*
|
||||
* @author Robin Chalas <robin.chalas@gmail.com>
|
||||
*/
|
||||
final class WorkerStoppedEvent
|
||||
{
|
||||
private Worker $worker;
|
||||
|
||||
public function __construct(Worker $worker)
|
||||
{
|
||||
$this->worker = $worker;
|
||||
}
|
||||
|
||||
public function getWorker(): Worker
|
||||
{
|
||||
return $this->worker;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user