scheduler

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTaskSubmitterNotInitialized 서비스 시작 시 핵심 의존성 객체인 TaskSubmitter가 올바르게 초기화되지 않았을 때 반환하는 에러입니다.
	ErrTaskSubmitterNotInitialized = apperrors.New(apperrors.Internal, "TaskSubmitter 객체가 초기화되지 않았습니다")

	// ErrNotificationSenderNotInitialized 서비스 시작 시 핵심 의존성 객체인 NotificationSender가 올바르게 초기화되지 않았을 때 반환하는 에러입니다.
	ErrNotificationSenderNotInitialized = apperrors.New(apperrors.Internal, "NotificationSender 객체가 초기화되지 않았습니다")
)

Functions

func NewErrInvalidCronSpec

func NewErrInvalidCronSpec(taskID, timeSpec string, cause error) error

NewErrInvalidCronSpec Cron 표현식이 올바르지 않아 스케줄 등록에 실패했을 때 반환하는 에러를 생성합니다.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service 애플리케이션 설정 파일(AppConfig)에 정의된 작업들을 Cron 스케줄에 맞춰 자동으로 실행하는 서비스입니다.

func NewService

func NewService(taskConfigs []config.TaskConfig, submitter contract.TaskSubmitter, notificationSender contract.NotificationSender) *Service

NewService 새로운 Scheduler 서비스 인스턴스를 생성합니다.

func (*Service) Start

func (s *Service) Start(serviceStopCtx context.Context, serviceStopWG *sync.WaitGroup) error

Start 스케줄러를 시작하고 설정 파일에 정의된 작업들을 Cron 엔진에 등록합니다.

매개변수:

  • serviceStopCtx: 서비스 종료 신호를 받기 위한 Context
  • serviceStopWG: 서비스 종료 완료를 알리기 위한 WaitGroup

반환값:

  • error: taskSubmitter 또는 notificationSender가 nil인 경우

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL