Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLog = log.New(os.Stderr, "[ERROR]", 0) InfoLog = log.New(os.Stdout, "[INFO]", 0) )
View Source
var ErrSchedulerClosed = errors.New("scheduler closed")
Functions ¶
This section is empty.
Types ¶
type OptionFunc ¶
type OptionFunc func(*Scheduler)
func SetExecutor ¶
func SetExecutor(executor Executor) OptionFunc
func SetLogger ¶
func SetLogger(logger Logger) OptionFunc
func SetRecoverFn ¶
func SetRecoverFn(fn RecoverFunc) OptionFunc
func SetTaskConcurrency ¶
func SetTaskConcurrency(c int) OptionFunc
func SetTaskSize ¶
func SetTaskSize(size int) OptionFunc
func SetTimeout ¶
func SetTimeout(dur time.Duration) OptionFunc
type RecoverFunc ¶
type RecoverFunc func()
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
func NewScheduler(opts ...OptionFunc) *Scheduler
func (*Scheduler) ExecutedCount ¶
func (*Scheduler) UnExecutedCount ¶
type SimpleExecutor ¶
type SimpleExecutor struct { }
func NewSimpleExecutor ¶
func NewSimpleExecutor() *SimpleExecutor
func (*SimpleExecutor) Do ¶
func (se *SimpleExecutor) Do(taskFunc TaskFunc) error
Click to show internal directories.
Click to hide internal directories.