Documentation
¶
Overview ¶
Example ¶
package main
import (
"fmt"
"time"
"github.com/donutloop/toolkit/worker"
)
func main() {
workerHandler := func(parameter interface{}) (interface{}, error) {
v := parameter.(string)
return v + " world", nil
}
request, response, _ := worker.New(2, workerHandler, 10)
request <- "hello"
<-time.After(time.Millisecond * 250)
fmt.Println(<-response)
}
Output: hello world
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.