FailoverTransport
extends RoundRobinTransport
in package
Uses several Transports using a failover algorithm.
Tags
Table of Contents
Properties
- $currentTransport : mixed
- $cursor : mixed
- $deadTransports : SplObjectStorage<TransportInterface, float>
- $retryPeriod : mixed
- $transports : mixed
Methods
- __construct() : mixed
- __toString() : string
- send() : SentMessage|null
- getInitialCursor() : int
- getNameSymbol() : string
- getNextTransport() : TransportInterface|null
- Rotates the transport list around and returns the first instance.
- isTransportDead() : bool
- moveCursor() : int
Properties
$currentTransport
private
mixed
$currentTransport
$cursor
private
mixed
$cursor
= -1
$deadTransports
private
SplObjectStorage<TransportInterface, float>
$deadTransports
$retryPeriod
private
mixed
$retryPeriod
$transports
private
mixed
$transports
= []
Methods
__construct()
public
__construct(array<string|int, TransportInterface> $transports[, int $retryPeriod = 60 ]) : mixed
Parameters
- $transports : array<string|int, TransportInterface>
- $retryPeriod : int = 60
__toString()
public
__toString() : string
Return values
stringsend()
public
send(RawMessage $message[, Envelope|null $envelope = null ]) : SentMessage|null
Parameters
- $message : RawMessage
- $envelope : Envelope|null = null
Return values
SentMessage|nullgetInitialCursor()
protected
getInitialCursor() : int
Return values
intgetNameSymbol()
protected
getNameSymbol() : string
Return values
stringgetNextTransport()
Rotates the transport list around and returns the first instance.
protected
getNextTransport() : TransportInterface|null
Return values
TransportInterface|nullisTransportDead()
protected
isTransportDead(TransportInterface $transport) : bool
Parameters
- $transport : TransportInterface
Return values
boolmoveCursor()
private
moveCursor(int $cursor) : int
Parameters
- $cursor : int