com.github.pgasync.TransactionExecutor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of postgres-async-driver Show documentation
Show all versions of postgres-async-driver Show documentation
Asynchronous PostgreSQL Java driver
package com.github.pgasync;
import rx.Observable;
import java.util.function.Consumer;
/**
* TransactionExecutor begins backend transactions.
*
* @author Antti Laisi
*/
public interface TransactionExecutor {
/**
* Begins a transaction.
*/
Observable begin();
/**
* Begins a transaction.
*
* @param onTransaction Called when transaction is successfully started.
* @param onError Called on exception thrown
*/
default void begin(Consumer onTransaction, Consumer onError) {
begin().subscribe(onTransaction::accept, onError::accept);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy