Skip to content

Commit

Permalink
BAC-546 Correct documentaion with singletone.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shirockov Igor committed Sep 9, 2021
1 parent fec01f6 commit 214084d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ func main() {

// Create FuncsMap and add our TaskFunc's
taskFuncsMap := scheduler.TaskFuncsMap{
"upd_print": PrintJobSingletone,
"upd_print": PrintJobSingleton,
"upd_printName": PrintWithArgs,
}

// Init TaskPlan for Singletone functions
// Init TaskPlan for Singleton functions
taskPlan := scheduler.TaskPlan{
"upd_print": updPrintScheduleTimeout,
}

// Init scheduler
sch := scheduler.New(db, &taskFuncsMap, sleepDuration) // gorm db in first func argument

// Add to DB and configure singletone tasks
// Add to DB and configure singleton tasks
sch.Configure(taskPlan)

// Run scheduler
Expand All @@ -133,9 +133,9 @@ func main() {
}

// Create schedule TaskFunc's
// PrintJobSingletone ...
func PrintJobSingletone(args scheduler.FuncArgs) (status scheduler.TaskStatus, when interface{}) {
log.Println("PrintJobSingletone:", time.Now())
// PrintJobSingleton ...
func PrintJobSingleton(args scheduler.FuncArgs) (status scheduler.TaskStatus, when interface{}) {
log.Println("PrintJobSingleton:", time.Now())

return scheduler.TaskStatusWait, time.Now().Add(time.Minute * 1)
}
Expand All @@ -155,8 +155,8 @@ func PrintWithArgs(args scheduler.FuncArgs) (status scheduler.TaskStatus, when i

# Task types

- Singletone - unique task, can be only one task with alias in DB.
- Not singletone - dynamic task, that can be created while the program is running, supports arguments, there can be several tasks in the database with one alias.
- Singleton - unique task, can be only one task with alias in DB.
- Not singleton - dynamic task, that can be created while the program is running, supports arguments, there can be several tasks in the database with one alias.

# Roadmap

Expand Down

0 comments on commit 214084d

Please sign in to comment.