Skip to content

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