/** @var string */
private $loadMonitorClass;
- /** @var int */
- private $maxLag;
-
- /** @var int Default 'maxLag' when unspecified */
- const MAX_LAG_DEFAULT = 10;
/**
* @see LBFactory::__construct()
$this->externalClusters = $conf['externalClusters'] ?? [];
$this->loadMonitorClass = $conf['loadMonitorClass'] ?? 'LoadMonitor';
- $this->maxLag = $conf['maxLag'] ?? self::MAX_LAG_DEFAULT;
}
/**
$this->baseLoadBalancerParams(),
[
'servers' => $servers,
- 'maxLag' => $this->maxLag,
'loadMonitor' => [ 'class' => $this->loadMonitorClass ],
]
) );
*/
public function forEachLB( $callback, array $params = [] ) {
if ( isset( $this->mainLB ) ) {
- call_user_func_array( $callback, array_merge( [ $this->mainLB ], $params ) );
+ $callback( $this->mainLB, ...$params );
}
foreach ( $this->extLBs as $lb ) {
- call_user_func_array( $callback, array_merge( [ $lb ], $params ) );
+ $callback( $lb, ...$params );
}
}
}