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

io.infinicast.HandlerPool Maven / Gradle / Ivy

There is a newer version: 3.0.9
Show newest version
package io.infinicast;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.Consumer;

public class HandlerPool {
    private ExecutorService sExecutor = Executors.newSingleThreadExecutor();


    public void QueueHandlerCall(final Action item) {
        sExecutor.execute(
                () -> item.accept());

    }


    public void Destroy() {

        if (sExecutor != null) {
            sExecutor.shutdown();
        }
    }

}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy