use of com.adobe.acs.commons.functions.RoundRobin in project acs-aem-commons by Adobe-Consulting-Services.
the class ReplicationActions method activateAllWithRoundRobin.
/**
* Activate all nodes using provided options NOTE: If using large batch
* publishing it is highly recommended to set synchronous to true on the
* replication options
*
* @param options
* @return
*/
public static final CheckedBiConsumer<ResourceResolver, String> activateAllWithRoundRobin(final Replicator replicator, final ReplicationOptions... options) {
final List<ReplicationOptions> allTheOptions = Arrays.asList(options);
final Iterator<ReplicationOptions> roundRobin = new RoundRobin(allTheOptions).iterator();
return (ResourceResolver r, String path) -> {
nameThread(PREFIX_ACTIVATE + path);
replicator.replicate(r.adaptTo(Session.class), ReplicationActionType.ACTIVATE, path, roundRobin.next());
};
}
Aggregations