Skip to content

ant-libs-go/safe_stop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SafeStop

safe_stop是基于sync.WaitGroup抽象的服务安全退出模块

License GoDoc Go Report Card

特性

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

安装

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

快速开始

// lock
safe_stop.Lock(1)

// safe exit
safe_stop.Wait()