update patch 1

This commit is contained in:
fiqhpratama
2024-12-02 01:18:34 +07:00
parent 453d9bb470
commit 25026b0a85
3380 changed files with 103529 additions and 363623 deletions
+6 -8
View File
@@ -28,22 +28,20 @@ class RoundRobinTransport implements TransportInterface
* @var \SplObjectStorage<TransportInterface, float>
*/
private \SplObjectStorage $deadTransports;
private array $transports = [];
private int $retryPeriod;
private int $cursor = -1;
/**
* @param TransportInterface[] $transports
*/
public function __construct(array $transports, int $retryPeriod = 60)
{
public function __construct(
private array $transports,
private int $retryPeriod = 60,
) {
if (!$transports) {
throw new TransportException(sprintf('"%s" must have at least one transport configured.', static::class));
throw new TransportException(\sprintf('"%s" must have at least one transport configured.', static::class));
}
$this->transports = $transports;
$this->deadTransports = new \SplObjectStorage();
$this->retryPeriod = $retryPeriod;
}
public function send(RawMessage $message, ?Envelope $envelope = null): ?SentMessage
@@ -55,7 +53,7 @@ class RoundRobinTransport implements TransportInterface
return $transport->send($message, $envelope);
} catch (TransportExceptionInterface $e) {
$exception ??= new TransportException('All transports failed.');
$exception->appendDebug(sprintf("Transport \"%s\": %s\n", $transport, $e->getDebug()));
$exception->appendDebug(\sprintf("Transport \"%s\": %s\n", $transport, $e->getDebug()));
$this->deadTransports[$transport] = microtime(true);
}
}