Scheduled tasks/jobs queue runner
Helps to run scheduled tasks in background.
Example
JobsQueue.Functions["plus"] = func(params map[string]interface{}) (interface{}, error) {
o1 := value.ToMapGet(params, "o1").Int()
o2 := value.ToMapGet(params, "o2").Int()
return o1 + o2, nil
}
JobsQueue.AddJob("plus", map[string]interface{}{"o1": 1, "o2": 2}, time.Now(), "")
JobsQueue.AddJob("plus", map[string]interface{}{"o1": 2, "o2": 3}, time.Now(), "")
JobsQueue.AddJob("plus", map[string]interface{}{"o1": 3, "o2": 4}, time.Now(), "15s")
JobsQueue.AddJob("plus", map[string]interface{}{"o1": 4, "o2": 5}, time.Now(), nil)