package com.persagy.adm.diagram.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class CustomThreadPoolConfig {

    @Bean("customThreadPool")
    public ThreadPoolExecutor executor() {
        return new ThreadPoolExecutor(4, 10,
                2000, TimeUnit.MICROSECONDS,
                new LinkedBlockingDeque<>(20));
    }
}
