run Future Task Later - Java java.util.concurrent

Java examples for java.util.concurrent:Future

Description

run Future Task Later

Demo Code


//package com.java2s;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Main {
    private static final ExecutorService executorService = Executors
            .newWorkStealingPool();/*from  w  w  w .j a  v a2  s. c o m*/

    public static Future<?> runTaskLater(final Runnable runnable) {

        return executorService.submit(runnable);

    }
}

Related Tutorials