GetReplicaStrategyFromIndexOptions
in package
Options for @see GetReplicaStrategy::fromIndex().
Tags
Table of Contents
- $wrap : bool
- build() : GetReplicaStrategyFromIndexOptions
- Static helper to keep code more readable
- wrap() : GetReplicaStrategyFromIndexOptions
- Resolve an index that cannot be read as requested to the next one that can, instead of failing with ReplicaIndexOutOfBoundsException or ReplicaIndexCurrentlyUnavailableException.
Properties
$wrap
private
bool
$wrap
= false
Methods
build()
Static helper to keep code more readable
public
static build() : GetReplicaStrategyFromIndexOptions
Tags
Return values
GetReplicaStrategyFromIndexOptions —wrap()
Resolve an index that cannot be read as requested to the next one that can, instead of failing with ReplicaIndexOutOfBoundsException or ReplicaIndexCurrentlyUnavailableException.
public
wrap(bool $wrap) : GetReplicaStrategyFromIndexOptions
The search walks the bucket's configured replica count, starting at the requested index modulo that count. Two failures remain: a bucket configured for no replicas still throws ReplicaIndexOutOfBoundsException, and a full lap that finds nothing readable throws ReplicaIndexCurrentlyUnavailableException.
Parameters
- $wrap : bool
-
whether to wrap around the available replicas