MCPcopy Index your code
hub / github.com/goinaction/code / createTask

Function createTask

chapter7/patterns/runner/main/main.go:44–49  ·  view source on GitHub ↗

createTask returns an example task that sleeps for the specified number of seconds based on the id.

()

Source from the content-addressed store, hash-verified

42// createTask returns an example task that sleeps for the specified
43// number of seconds based on the id.
44func 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}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected