Documentation ¶
Index ¶
- type CronExpression
- type CronTrigger
- type MultiCronExpression
- type Option
- type ScheduledRunnableTask
- type ScheduledTask
- type ScheduledTaskQueue
- type SchedulerTask
- type SimpleCronExpression
- type SimpleTaskExecutor
- func (executor *SimpleTaskExecutor) IsShutdown() bool
- func (executor *SimpleTaskExecutor) Schedule(task Task, delay time.Duration) (ScheduledTask, error)
- func (executor *SimpleTaskExecutor) ScheduleAtFixedRate(task Task, initialDelay time.Duration, period time.Duration) (ScheduledTask, error)
- func (executor *SimpleTaskExecutor) ScheduleWithFixedDelay(task Task, initialDelay time.Duration, delay time.Duration) (ScheduledTask, error)
- func (executor *SimpleTaskExecutor) Shutdown() chan bool
- type SimpleTaskRunner
- type SimpleTaskScheduler
- func (scheduler *SimpleTaskScheduler) IsShutdown() bool
- func (scheduler *SimpleTaskScheduler) Schedule(task Task, options ...Option) (ScheduledTask, error)
- func (scheduler *SimpleTaskScheduler) ScheduleAtFixedRate(task Task, period time.Duration, options ...Option) (ScheduledTask, error)
- func (scheduler *SimpleTaskScheduler) ScheduleWithCron(task Task, expression string, options ...Option) (ScheduledTask, error)
- func (scheduler *SimpleTaskScheduler) ScheduleWithFixedDelay(task Task, delay time.Duration, options ...Option) (ScheduledTask, error)
- func (scheduler *SimpleTaskScheduler) Shutdown() chan bool
- type SimpleTriggerContext
- func (ctx *SimpleTriggerContext) LastCompletionTime() time.Time
- func (ctx *SimpleTriggerContext) LastExecutionTime() time.Time
- func (ctx *SimpleTriggerContext) LastTriggeredExecutionTime() time.Time
- func (ctx *SimpleTriggerContext) Update(lastCompletionTime time.Time, lastExecutionTime time.Time, ...)
- type Task
- type TaskExecutor
- type TaskRunner
- type TaskScheduler
- type Trigger
- type TriggerContext
- type TriggerTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CronExpression ¶
func ParseCronExpression ¶
func ParseCronExpression(expression string) (CronExpression, error)
type CronTrigger ¶
type CronTrigger struct {
// contains filtered or unexported fields
}
func CreateCronTrigger ¶
func CreateCronTrigger(expression string, location *time.Location) (*CronTrigger, error)
func (*CronTrigger) NextExecutionTime ¶
func (trigger *CronTrigger) NextExecutionTime(ctx TriggerContext) time.Time
type MultiCronExpression ¶
type MultiCronExpression struct {
// contains filtered or unexported fields
}
func (*MultiCronExpression) GetLocation ¶
func (expression *MultiCronExpression) GetLocation() *time.Location
type ScheduledRunnableTask ¶
type ScheduledRunnableTask struct {
// contains filtered or unexported fields
}
func (*ScheduledRunnableTask) Cancel ¶
func (scheduledRunnableTask *ScheduledRunnableTask) Cancel()
func (*ScheduledRunnableTask) IsCancelled ¶
func (scheduledRunnableTask *ScheduledRunnableTask) IsCancelled() bool
type ScheduledTask ¶
type ScheduledTask interface { Cancel() IsCancelled() bool }
type ScheduledTaskQueue ¶
type ScheduledTaskQueue []*ScheduledRunnableTask
func (ScheduledTaskQueue) Len ¶
func (queue ScheduledTaskQueue) Len() int
func (ScheduledTaskQueue) Less ¶
func (queue ScheduledTaskQueue) Less(i, j int) bool
func (ScheduledTaskQueue) SorByTriggerTime ¶
func (queue ScheduledTaskQueue) SorByTriggerTime()
func (ScheduledTaskQueue) Swap ¶
func (queue ScheduledTaskQueue) Swap(i, j int)
type SchedulerTask ¶
type SchedulerTask struct {
// contains filtered or unexported fields
}
func CreateSchedulerTask ¶
func CreateSchedulerTask(task Task, options ...Option) (*SchedulerTask, error)
func (*SchedulerTask) GetInitialDelay ¶
func (task *SchedulerTask) GetInitialDelay() time.Duration
type SimpleCronExpression ¶
type SimpleCronExpression struct {
// contains filtered or unexported fields
}
func ParseSingleCronExpression ¶
func ParseSingleCronExpression(expression string) (*SimpleCronExpression, error)
func (*SimpleCronExpression) GetLocation ¶
func (expression *SimpleCronExpression) GetLocation() *time.Location
type SimpleTaskExecutor ¶
type SimpleTaskExecutor struct {
// contains filtered or unexported fields
}
func NewSimpleTaskExecutor ¶
func NewSimpleTaskExecutor(runner TaskRunner) *SimpleTaskExecutor
func (*SimpleTaskExecutor) IsShutdown ¶
func (executor *SimpleTaskExecutor) IsShutdown() bool
func (*SimpleTaskExecutor) Schedule ¶
func (executor *SimpleTaskExecutor) Schedule(task Task, delay time.Duration) (ScheduledTask, error)
func (*SimpleTaskExecutor) ScheduleAtFixedRate ¶
func (executor *SimpleTaskExecutor) ScheduleAtFixedRate(task Task, initialDelay time.Duration, period time.Duration) (ScheduledTask, error)
func (*SimpleTaskExecutor) ScheduleWithFixedDelay ¶
func (executor *SimpleTaskExecutor) ScheduleWithFixedDelay(task Task, initialDelay time.Duration, delay time.Duration) (ScheduledTask, error)
func (*SimpleTaskExecutor) Shutdown ¶
func (executor *SimpleTaskExecutor) Shutdown() chan bool
type SimpleTaskRunner ¶
type SimpleTaskRunner struct { }
func NewSimpleTaskRunner ¶
func NewSimpleTaskRunner() *SimpleTaskRunner
func (*SimpleTaskRunner) Run ¶
func (runner *SimpleTaskRunner) Run(task Task)
type SimpleTaskScheduler ¶
type SimpleTaskScheduler struct {
// contains filtered or unexported fields
}
func NewSimpleTaskScheduler ¶
func NewSimpleTaskScheduler(executor TaskExecutor) *SimpleTaskScheduler
func (*SimpleTaskScheduler) IsShutdown ¶
func (scheduler *SimpleTaskScheduler) IsShutdown() bool
func (*SimpleTaskScheduler) Schedule ¶
func (scheduler *SimpleTaskScheduler) Schedule(task Task, options ...Option) (ScheduledTask, error)
func (*SimpleTaskScheduler) ScheduleAtFixedRate ¶
func (scheduler *SimpleTaskScheduler) ScheduleAtFixedRate(task Task, period time.Duration, options ...Option) (ScheduledTask, error)
func (*SimpleTaskScheduler) ScheduleWithCron ¶
func (scheduler *SimpleTaskScheduler) ScheduleWithCron(task Task, expression string, options ...Option) (ScheduledTask, error)
func (*SimpleTaskScheduler) ScheduleWithFixedDelay ¶
func (scheduler *SimpleTaskScheduler) ScheduleWithFixedDelay(task Task, delay time.Duration, options ...Option) (ScheduledTask, error)
func (*SimpleTaskScheduler) Shutdown ¶
func (scheduler *SimpleTaskScheduler) Shutdown() chan bool
type SimpleTriggerContext ¶
type SimpleTriggerContext struct {
// contains filtered or unexported fields
}
func NewSimpleTriggerContext ¶
func NewSimpleTriggerContext() *SimpleTriggerContext
func (*SimpleTriggerContext) LastCompletionTime ¶
func (ctx *SimpleTriggerContext) LastCompletionTime() time.Time
func (*SimpleTriggerContext) LastExecutionTime ¶
func (ctx *SimpleTriggerContext) LastExecutionTime() time.Time
func (*SimpleTriggerContext) LastTriggeredExecutionTime ¶
func (ctx *SimpleTriggerContext) LastTriggeredExecutionTime() time.Time
type TaskExecutor ¶
type TaskExecutor interface { Schedule(task Task, delay time.Duration) (ScheduledTask, error) ScheduleWithFixedDelay(task Task, initialDelay time.Duration, delay time.Duration) (ScheduledTask, error) ScheduleAtFixedRate(task Task, initialDelay time.Duration, period time.Duration) (ScheduledTask, error) IsShutdown() bool Shutdown() chan bool }
func NewDefaultTaskExecutor ¶
func NewDefaultTaskExecutor() TaskExecutor
type TaskRunner ¶
type TaskRunner interface {
Run(task Task)
}
func NewDefaultTaskRunner ¶
func NewDefaultTaskRunner() TaskRunner
type TaskScheduler ¶
type TaskScheduler interface { Schedule(task Task, options ...Option) (ScheduledTask, error) ScheduleWithCron(task Task, expression string, options ...Option) (ScheduledTask, error) ScheduleWithFixedDelay(task Task, delay time.Duration, options ...Option) (ScheduledTask, error) ScheduleAtFixedRate(task Task, period time.Duration, options ...Option) (ScheduledTask, error) IsShutdown() bool Shutdown() chan bool }
func NewDefaultTaskScheduler ¶
func NewDefaultTaskScheduler() TaskScheduler
type Trigger ¶
type Trigger interface {
NextExecutionTime(ctx TriggerContext) time.Time
}
type TriggerContext ¶
type TriggerTask ¶
type TriggerTask struct {
// contains filtered or unexported fields
}
func CreateTriggerTask ¶
func CreateTriggerTask(task Task, executor TaskExecutor, trigger Trigger) (*TriggerTask, error)
func (*TriggerTask) Cancel ¶
func (task *TriggerTask) Cancel()
func (*TriggerTask) IsCancelled ¶
func (task *TriggerTask) IsCancelled() bool
func (*TriggerTask) Run ¶
func (task *TriggerTask) Run(ctx context.Context)
func (*TriggerTask) Schedule ¶
func (task *TriggerTask) Schedule() (ScheduledTask, error)
Click to show internal directories.
Click to hide internal directories.