Skip to content

a distributed cron job processor written by golang

License

Notifications You must be signed in to change notification settings

imiskolee/litecron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiteCron


What's LiteCron

LiteCron is a In-Processing distributed cron job processor. its easy to handle you cron job into you web app. you don't need any special machine for run cron job.

UseCase

  • running cron job into my web app.
  • build a distributed cron job service(for replace system cron service).

UseAge

//Step 1: init default cron client.
	litecron.InitDefaultCron(&litecron.MutexConfig{
		RedisConfig:&litecron.RedisConfig{
			DNS:"127.0.0.1:6379",
		},
		Prefix:"litecron/examples/defaults/",
		Factor:0.01,
	})
	//Register a cron job for every 2 seconds.
	litecron.Register("@every 2s",exampleHandle)
	go litecron.Run()
	time.Sleep(10 * time.Second)
	// Output:

Examples

  1. default cron client
  2. without default cron client
  3. mock multi processor

Deps & Thanks

About

a distributed cron job processor written by golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages