Documentation

GetReplicaStrategyFromIndexOptions
in package

Options for @see GetReplicaStrategy::fromIndex().

Tags
since
4.6.0

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

Methods

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

Tags
since
4.6.0
Return values
GetReplicaStrategyFromIndexOptions —

        

Search results