Class IracResponseCollector

java.lang.Object
java.util.concurrent.CompletableFuture<Void>
org.infinispan.xsite.irac.IracResponseCollector
All Implemented Interfaces:
CompletionStage<Void>, Future<Void>, BiConsumer<IntSet,Throwable>

public class IracResponseCollector extends CompletableFuture<Void> implements BiConsumer<IntSet,Throwable>
A response collector for an asynchronous cross site requests.

Multiple keys are batched together in a single requests. The remote site sends a IntSet back where if bit n is set, it means the nth key in the batch failed to be applied (example, lock failed to be acquired), and it needs to be retried.

If an Exception is received (example, timed-out waiting for the remote site ack), it assumes all keys in the batch aren't applied, and they are retried.

When the response (or exception) is received, IracResponseCollector.IracResponseCompleted.onResponseCompleted(IracBatchSendResult, Collection) is invoked with the global result in IracBatchSendResult and a collection with all the successfully applied keys. Once the listener finishes execution, the CompletableFuture completes (completed value not relevant, and it is never completed exceptionally).

Since:
12
Author:
Pedro Ruivo