package cn.superdesk.uniorder.config.thread;


import cn.hutool.core.thread.ThreadUtil;
import cn.superdesk.uniorder.lib.thread.StandardThreadExecutor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ExecutorService;

@Configuration
public class ThreadPoolConfig {

    @Bean
    public ExecutorService executorService() {
        return ThreadUtil.newExecutor(1, 1);
    }

    @Bean
    public StandardThreadExecutor standardThreadExecutor() {
        StandardThreadExecutor standardThreadExecutor = new StandardThreadExecutor();
        return standardThreadExecutor;
    }
}
