-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Async ThreadPool설정 클래스 위치 이동
- Loading branch information
Showing
3 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,32 @@ | ||
package com.festago.config; | ||
|
||
import java.util.concurrent.Executor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableAsync; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
||
@EnableAsync | ||
@Configuration | ||
public class AsyncConfig { | ||
|
||
private static final String DEFAULT_EXECUTOR_NAME = "taskExecutor"; | ||
public static final String FCM_EXECUTOR_NAME = "fcmExecutor"; | ||
|
||
@Bean(name = DEFAULT_EXECUTOR_NAME) | ||
public Executor defaultExecutor() { | ||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
executor.setCorePoolSize(8); | ||
executor.initialize(); | ||
return executor; | ||
} | ||
|
||
@Bean(name = FCM_EXECUTOR_NAME) | ||
public Executor fcmExecutor() { | ||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
executor.setCorePoolSize(4); | ||
executor.setQueueCapacity(10); | ||
executor.initialize(); | ||
return executor; | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
backend/src/main/java/com/festago/config/SchedulingConfig.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,10 @@ | ||
package com.festago.config; | ||
|
||
import java.util.concurrent.Executor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
||
@Configuration | ||
@EnableScheduling | ||
public class SchedulingConfig { | ||
|
||
private static final String DEFAULT_EXECUTOR_NAME = "taskExecutor"; | ||
public static final String FCM_EXECUTOR_NAME = "fcmExecutor"; | ||
|
||
@Bean(name = DEFAULT_EXECUTOR_NAME) | ||
public Executor defaultExecutor() { | ||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
executor.setCorePoolSize(8); | ||
executor.initialize(); | ||
return executor; | ||
} | ||
|
||
@Bean(name = FCM_EXECUTOR_NAME) | ||
public Executor fcmExecutor() { | ||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
executor.setCorePoolSize(4); | ||
executor.setQueueCapacity(10); | ||
executor.initialize(); | ||
return executor; | ||
} | ||
} |
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