Skip to content

cheekybits/jobs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jobs

GoDoc

Job management for MongoDB (via mgo).

  • Simple API
  • Jobs guaranteed to run only once (no matter how many runners)
  • Retries
  • Run jobs ASAP, or at a future date
  • MongoDB as its backend

Usage

// create a job and set some data
job := jobs.New("notifications")
job.Data["message"] = "Hello world"

// put the job
jobs.Put(db.C("jobs"), job)

Meanwhile, in a process far, far away:

r := jobs.NewRunner("runner-1", db.C("jobs"), "notifications", func(j *jobs.J) error {
	log.Println("TODO: process this message -", j.Data["message"])
	return nil
})
r.Start()

About

Jobs API for Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published