
com.gruelbox.transactionoutbox.ThrowingTransactionalSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transactionoutbox-core Show documentation
Show all versions of transactionoutbox-core Show documentation
A safe implementation of the transactional outbox pattern for Java (core library)
package com.gruelbox.transactionoutbox;
@FunctionalInterface
public interface ThrowingTransactionalSupplier {
static ThrowingTransactionalSupplier fromRunnable(
Runnable runnable) {
return transaction -> {
runnable.run();
return null;
};
}
static ThrowingTransactionalSupplier fromWork(
ThrowingTransactionalWork work) {
return transaction -> {
work.doWork(transaction);
return null;
};
}
static ThrowingTransactionalSupplier fromWork(TransactionalWork work) {
return transaction -> {
work.doWork(transaction);
return null;
};
}
static ThrowingTransactionalSupplier fromSupplier(
TransactionalSupplier work) {
return work::doWork;
}
T doWork(Transaction transaction) throws E;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy