Created
May 6, 2020 08:56
-
-
Save cloudhuang/63928b7b7986ba8ac0e6af9359b774f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class ExecuteServiceConfiguration { | |
@Bean | |
public ExecutorService executorService() { | |
return new ThreadPoolExecutor( | |
20, | |
50, | |
60, TimeUnit.SECONDS, | |
new ArrayBlockingQueue<>(2000), r -> { | |
Thread thread = new Thread(r); | |
thread.setName("Backend-Executor"); | |
return thread; | |
}, new ThreadPoolExecutor.CallerRunsPolicy()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment