// Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
// 
//     /**
//      * Performs this operation on the given argument.
//      *
//      * @param t the input argument
//      */
//     void accept(T t) throws Exception;
// }
// 
// Path: futuristic-core/src/main/java/io/futuristic/function/ExceptionTrapper.java
// public interface ExceptionTrapper<E extends Exception, R> {
// 
//     R trap(E exception) throws Exception;
// 
// }
// 
// Path: futuristic-core/src/main/java/io/futuristic/function/FunctionWithException.java
// public interface FunctionWithException<T, R> {
// 
//     /**
//      * Applies this function to the given argument.
//      *
//      * @param t the function argument
//      * @return the function result
//      */
//     R apply(T t) throws Exception;
// }


import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException;
package io.futuristic;


/**
 * @autor: julio
 */
public interface Future<T> {

    /**
     * Blocks the call until the future value is available.
     * @return
     * @throws Exception
     */
    public T await() throws Exception;

    /**
     * Called when the future value is available.
     * @param consumer
     * @return
     */
    public Future<T> consume(ConsumerWithException<T> consumer);

    /**
     * Called when the future value is available.
     * @param callback
     * @return
     */
// Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
// 
//     /**
//      * Performs this operation on the given argument.
//      *
//      * @param t the input argument
//      */
//     void accept(T t) throws Exception;
// }
// 
// Path: futuristic-core/src/main/java/io/futuristic/function/ExceptionTrapper.java
// public interface ExceptionTrapper<E extends Exception, R> {
// 
//     R trap(E exception) throws Exception;
// 
// }
// 
// Path: futuristic-core/src/main/java/io/futuristic/function/FunctionWithException.java
// public interface FunctionWithException<T, R> {
// 
//     /**
//      * Applies this function to the given argument.
//      *
//      * @param t the function argument
//      * @return the function result
//      */
//     R apply(T t) throws Exception;
// }


// Path: futuristic-core/src/main/java/io/futuristic/Future.java
import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException;

package io.futuristic;


/**
 * @autor: julio
 */
public interface Future<T> {

    /**
     * Blocks the call until the future value is available.
     * @return
     * @throws Exception
     */
    public T await() throws Exception;

    /**
     * Called when the future value is available.
     * @param consumer
     * @return
     */
    public Future<T> consume(ConsumerWithException<T> consumer);

    /**
     * Called when the future value is available.
     * @param callback
     * @return
     */
    default void consume(Callback<T> callback){