Documentation
¶
Index ¶
- Variables
- func Cancel(n *Node)
- func CancelAll()
- func Join()
- func Len() int
- func PeriodicCrontab(crontab string) func() time.Time
- func PeriodicEveryDay(tim string) func() time.Time
- func PeriodicInterval(offset time.Duration, interval time.Duration) func() time.Time
- func PeriodicIntervalCount(start time.Time, interval time.Duration, count int) func() time.Time
- func PeriodicMerge(fs ...func() time.Time) func() time.Time
- func PeriodicTiming(ts ...time.Time) func() time.Time
- func Print()
- type Node
- type Schedule
- type Spacing
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = NewTask(runtime.NumCPU() + 2)
Default task instance
View Source
var TaskExit = time.Time{}
TaskExit exit time
Functions ¶
func PeriodicCrontab ¶
PeriodicCrontab this is a crontab style timer six columns mean:
second:0-59 minute:0-59 hour:1-23 day:1-31 month:1-12 week:0-6(0 means Sunday)
SetCron some signals:
*: any time ,: separate signal
-:duration
/n : do as n times of time duration
///////////////////////////////////////////////////////
0/30 * * * * * every 30s 0 43 21 * * * 21:43 0 15 05 * * * 05:15 0 0 17 * * * 17:00 0 0 17 * * 1 17:00 in every Monday 0 0,10 17 * * 0,2,3 17:00 and 17:10 in every Sunday, Tuesday and Wednesday 0 0-10 17 1 * * 17:00 to 17:10 in 1 min duration each time on the first day of month 0 0 0 1,15 * 1 0:00 on the 1st day and 15th day of month 0 42 4 1 * * 4:42 on the 1st day of month 0 0 21 * * 1-6 21:00 from Monday to Saturday 0 0,10,20,30,40,50 * * * * every 10 min duration 0 */10 * * * * every 10 min duration 0 * 1 * * * 1:00 to 1:59 in 1 min duration each time 0 0 1 * * * 1:00 0 0 */1 * * * 0 min of hour in 1 hour duration 0 0 * * * * 0 min of hour in 1 hour duration 0 2 8-20/3 * * * 8:02, 11:02, 14:02, 17:02, 20:02 0 30 5 1,15 * * 5:30 on the 1st day and 15th day of month
func PeriodicEveryDay ¶
PeriodicEveryDay is a fixed time of day
15:04:05 of 15:04:05.999999999 This time of day 2006-01-02 15:04:05.999999999 This time of day from a certain date
func PeriodicInterval ¶
PeriodicInterval is generates a fixed interval time function, unlimited number of times
func PeriodicIntervalCount ¶
PeriodicIntervalCount is generates a fixed interval time function
func PeriodicTiming ¶
PeriodicTiming is multiple time for execution
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is store tasks
func AddPeriodic ¶
AddPeriodic Periodic execution
type Schedule ¶
type Schedule struct { Second uint64 Minute uint64 Hour uint64 Day uint64 Month uint64 Week uint64 }
Schedule time taks schedule
type Spacing ¶
type Spacing struct {
// contains filtered or unexported fields
}
Spacing is interval to perform
func NewSpacing ¶
NewSpacing create a fixed interval
func NewSpacingPeriodic ¶
NewSpacingPeriodic create a compute interval
Click to show internal directories.
Click to hide internal directories.