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

pl.allegro.tech.hermes.common.concurrent.DefaultExecutorServiceFactory Maven / Gradle / Ivy

The newest version!
package pl.allegro.tech.hermes.common.concurrent;

import com.google.common.util.concurrent.ThreadFactoryBuilder;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

public class DefaultExecutorServiceFactory implements ExecutorServiceFactory {

    @Override
    public ScheduledExecutorService createSingleThreadScheduledExecutor(String nameFormat) {
        return Executors.newSingleThreadScheduledExecutor(
                new ThreadFactoryBuilder().setNameFormat(nameFormat).build()
        );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy