Skip to content

ant-libs-go/looper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Looper

looper是一个简单的循环调度器

License GoDoc Go Report Card

特性

  • 支持多个任务间隔指定时间运行
  • 支持多实例部署情况下,避免并发运行

安装

go get github.com/ant-libs-go/looper

快速开始

l := looper.New()
l.AddFunc("task01", 10 * time.Second, nil, 0, func() { ... })
l.AddFunc("task02", 10 * time.Second, nil, 0, func() { ... })
l.AddFunc("task03", 10 * time.Second, nil, 0, func() { ... })
l.Start()
...
l.Stop()