Skip to content

deepaksinghvi/cduledemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cduledemo

A demo project for cdule library.

Usage Instructions or Steps

1. cdule library

Add cdule library as the dependency

go get github.com/deepaksinghvi/cdule

or use the following for go1.18 with tag v1.0.3

go1.18beta2 get github.com/deepaksinghvi/cdule@v1.0.3

2. Initiate Cdule Background Watcher

cdule := cdule.Cdule{}
cdule.NewCdule()

3. Build Job

testJob := job2.TestJob{}
jobData := make(map[string]string)
jobData["one"] = "1"
jobData["two"] = "2"
jobData["three"] = "3"
testJobModel, _ := watcher.NewJob(&testJob, jobData).Build(utils.EveryMinute)

On submission with the help of the Build() method, job will get scheduled and it will keep running it based on the cron scheduled provided.

4. Stop Cdule Watcher

time.Sleep(5 * time.Minute)
cdule.StopWatcher()

5. Run From command Line

Worker name to be picked based on the hostname

./cduledemo

or worker name can be supplied in the format of cduledemo

cduledemo worker1

For more details check documentation.

About

demo project for cdule library integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages