java.lang.Object
com.elex_project.chronos.Chronos
API entry point for scheduling tasks.
Chronos.init(16);
Chronos.scheduler()
.task(() -> { })
.every(1, TimeUnit.SECONDS)
.schedule();
Chronos.shutdown();
- Since:
- 2026-06-28
-
Method Summary
Modifier and TypeMethodDescriptionvoid특정 태스크를 완전히 취소하고 스케줄러에서 제거합니다.static ChronosgetScheduledFuture(String taskId) getTaskContext(String taskId) static voidinit(int corePoolSize) 원하는 스레드 풀 크기로 최초 1회 초기화합니다.boolean태스크의 일시 정지 여부를 확인합니다.booleanisRegistered(String taskId) void특정 태스크를 일시 정지합니다.voidregister(TaskContext context, ScheduledFuture<?> initialFuture) 새로운 태스크를 매니저에 등록하고 스케줄링을 시작합니다.void일시 정지된 태스크를 다시 재개합니다.static voidscanAndRegister(String basePackage) 특정 패키지 내의 @TaskComponent 클래스들을 찾아 내부 @Task 메서드를 엔진에 등록합니다.static ChronosBuilder.JobStepStarts a new task scheduling process.static ChronosBuilder.JobStepStarts a new task scheduling process.voidshutdown()모든 태스크를 종료하고 스케줄러 엔진을 폐쇄합니다.voidupdateFuture(String taskId, ScheduledFuture<?> newFuture) 실행 중인 특정 Future 자원을 업데이트합니다 (엔진 내부 재귀 호출 시 사용)
-
Method Details
-
init
public static void init(int corePoolSize) 원하는 스레드 풀 크기로 최초 1회 초기화합니다.- Parameters:
corePoolSize- the number of threads in the pool, default is 4.- Throws:
IllegalStateException- if the instance is already initialized.
-
getInstance
- Returns:
- ChronosManager instance
-
getTaskIds
-
isRegistered
-
getTaskContext
-
getScheduledFuture
-
register
새로운 태스크를 매니저에 등록하고 스케줄링을 시작합니다. -
updateFuture
실행 중인 특정 Future 자원을 업데이트합니다 (엔진 내부 재귀 호출 시 사용) -
pause
특정 태스크를 일시 정지합니다. (스케줄 루프는 돌지만 비즈니스 로직 실행이 차단됨)- Parameters:
taskId- unique identifier for the task
-
resume
일시 정지된 태스크를 다시 재개합니다.- Parameters:
taskId- unique identifier for the task
-
isPaused
태스크의 일시 정지 여부를 확인합니다.- Parameters:
taskId- unique identifier for the task
-
cancel
특정 태스크를 완전히 취소하고 스케줄러에서 제거합니다.- Parameters:
taskId- unique identifier for the task
-
shutdown
public void shutdown()모든 태스크를 종료하고 스케줄러 엔진을 폐쇄합니다. -
scheduler
Starts a new task scheduling process.- Returns:
- builder for fluent API
-
scheduler
Starts a new task scheduling process.- Parameters:
taskId- unique identifier for the task- Returns:
- builder for fluent API
-
scanAndRegister
특정 패키지 내의 @TaskComponent 클래스들을 찾아 내부 @Task 메서드를 엔진에 등록합니다.
-