io.infinicast.HandlerPool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinicast-client-jdk8 Show documentation
Show all versions of infinicast-client-jdk8 Show documentation
Infinicast SDK to communicate with the cloud.
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();
}
}
}