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

org.smallibs.concurrent.execution.Executor Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
/*
 * HPAS
 * https://github.com/d-plaindoux/hpas
 *
 * Copyright (c) 2016-2017 Didier Plaindoux
 * Licensed under the LGPL2 license.
 */

package org.smallibs.concurrent.execution;

import org.smallibs.concurrent.promise.Promise;
import org.smallibs.data.Unit;

import java.util.concurrent.Callable;

public interface Executor {

    @FunctionalInterface
    interface RunnableWithError {
        void run() throws Exception;
    }

    /**
     * Async method
     *
     * @param task the task to be asynchronously executed
     * @return a promise
     */
     Promise async(Callable task);

    /**
     * Async method
     *
     * @param task the task to be asynchronously executed
     * @return a promise
     */
    Promise async(RunnableWithError task);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy