Skip to content

Instantly share code, notes, and snippets.

@cloudhuang
Created May 6, 2020 08:56
Show Gist options
  • Save cloudhuang/63928b7b7986ba8ac0e6af9359b774f2 to your computer and use it in GitHub Desktop.
Save cloudhuang/63928b7b7986ba8ac0e6af9359b774f2 to your computer and use it in GitHub Desktop.
@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