com.obsidiandynamics.blackstrom.ledger.FutureAppendCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of blackstrom-core Show documentation
Show all versions of blackstrom-core Show documentation
Transactional event fabric for the JVM
The newest version!
package com.obsidiandynamics.blackstrom.ledger;
import java.util.concurrent.*;
import com.obsidiandynamics.blackstrom.model.*;
/**
* An {@link AppendCallback} implementation in the form of a {@link CompletableFuture}.
*/
public final class FutureAppendCallback extends CompletableFuture implements AppendCallback {
@Override
public void onAppend(MessageId messageId, Throwable error) {
if (error != null) {
completeExceptionally(error);
} else {
complete(messageId);
}
}
}