All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.obsidiandynamics.blackstrom.ledger.FutureAppendCallback Maven / Gradle / Ivy

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);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy