com.github.ddth.cql.utils.Callback Maven / Gradle / Ivy
package com.github.ddth.cql.utils;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
/**
* A callback for processing result of CQL execution asynchronously.
*
* @author Thanh Nguyen
* @since 1.0.0
*/
public interface Callback {
/**
* Invoked when computation is successful.
*
* @param result
*/
void onSuccess(T result);
/**
* Invoked when computation fails or is canceled.
*
*
* If the future's {@link Future#get() get} method throws an {@link ExecutionException}, then
* the cause is passed to this method. Any other thrown object is passed unaltered.
*
*/
void onFailure(Throwable t);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy