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

org.vfdtech.wrappers.VCompletableFuture Maven / Gradle / Ivy

Go to download

A utilities service with generic tools implementation. Can be plugged into your java project

There is a newer version: 0.3.5
Show newest version
package org.vfdtech.wrappers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.CompletableFuture;

public class VCompletableFuture extends CompletableFuture {
    private static final Logger log = LoggerFactory.getLogger(VCompletableFuture.class);

    public static void asyncRun(Runnable runnable) {
        runAsync(runnable).handle((msg, ex) -> {
            if (ex != null) {
                log.error("== ERROR OCCURRED: ", ex);
            }
            return null;
        });
    }

    public static  CompletableFuture asyncSupply(Runnable runnable) {
        return supplyAsync(() -> runnable).handle((msg, ex) -> {
            if (ex != null) {
                log.error("== ERROR OCCURRED: ", ex);
            }
            return null;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy