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