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

com.github.pgasync.TransactionExecutor Maven / Gradle / Ivy

There is a newer version: 0.9
Show newest version
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