com.obsidiandynamics.blackstrom.ledger.AppendCallback 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.io.*;
import java.util.function.*;
import com.obsidiandynamics.blackstrom.model.*;
@FunctionalInterface
public interface AppendCallback {
static AppendCallback errorLoggingAppendCallback(PrintStream stream) {
return appendErrorHandler(x -> x.printStackTrace(stream));
}
static AppendCallback appendErrorHandler(Consumer errorHandler) {
return (__id, error) -> {
if (error != null) errorHandler.accept(error);
};
}
static AppendCallback nop() { return (__id, __error) -> {}; }
void onAppend(MessageId messageId, Throwable error);
}