+
Skip to content
/ cow Public

A Call Out Wheel which schedules and fires callbacks in the background of your Go programs.

License

Notifications You must be signed in to change notification settings

jacygao/cow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cow

CI codecov

Package cow implements a Call Out Wheel which schedules and fires callbacks in the background of your Go programs.

Sample Usage


// Init call out wheel with default configuration
cli := cow.New()

// Start spins the wheel
cli.Start()

// Gracefully stop the wheel
defer cli.Stop()

// Schedule a callback in 5 seconds
cli.Schedule(5 * time.Seconds, []byte("your data"), func(data []byte){
    fmt.Printf("callback is triggerred with data %s", string(data))
})

Configuration

// Init call out wheel with custom tick interval
cli := cow.New(cow.WithTickInterval(time.Second * 10))

About

A Call Out Wheel which schedules and fires callbacks in the background of your Go programs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载