createTask returns an example task that sleeps for the specified number of seconds based on the id.
()
| 42 | // createTask returns an example task that sleeps for the specified |
| 43 | // number of seconds based on the id. |
| 44 | func createTask() func(int) { |
| 45 | return func(id int) { |
| 46 | log.Printf("Processor - Task #%d.", id) |
| 47 | time.Sleep(time.Duration(id) * time.Second) |
| 48 | } |
| 49 | } |