Versions in this module Expand all Collapse all v1 v1.0.1 Apr 6, 2022 v1.0.0 Mar 24, 2022 Changes in this version + var ErrLog = log.New(os.Stderr, "[ERROR]", 0) + var ErrSchedulerClosed = errors.New("scheduler closed") + var InfoLog = log.New(os.Stdout, "[INFO]", 0) + type Executor interface + Do func(TaskFunc) error + type Logger interface + Errorf func(string, ...interface{}) + Infof func(string, ...interface{}) + type OptionFunc func(*Scheduler) + func SetExecutor(executor Executor) OptionFunc + func SetLogger(logger Logger) OptionFunc + func SetRecoverFn(fn RecoverFunc) OptionFunc + func SetTaskConcurrency(c int) OptionFunc + func SetTaskSize(size int) OptionFunc + func SetTimeout(dur time.Duration) OptionFunc + type RecoverFunc func() + type Scheduler struct + func NewScheduler(opts ...OptionFunc) *Scheduler + func (s *Scheduler) AddTask(fn TaskFunc) error + func (s *Scheduler) Closed() bool + func (s *Scheduler) Error() string + func (s *Scheduler) ExecutedCount() int + func (s *Scheduler) Finish() + func (s *Scheduler) Start() + func (s *Scheduler) UnExecutedCount() int + func (s *Scheduler) Wait() + type SimpleExecutor struct + func NewSimpleExecutor() *SimpleExecutor + func (se *SimpleExecutor) Do(taskFunc TaskFunc) error + type TaskFunc func() error