The actual usage is very straight forward and the only unusual aspect is that this maintenance script uses a special load-group that requires special handling:
$dbr = $loadBalancerFactory->getMainLB()->getConnection( DB_REPLICA, [ 'vslow' ] ); $dbw = $loadBalancerFactory->getMainLB()->getConnection( DB_PRIMARY );
$loadBalancerFactory->waitForReplication();