Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a pool of multiple managed workers.
type Task ¶
type Task struct { Fn func(params []interface{}) Params []interface{} }
Task represents the combination of a function and parameters to be executed by a worker. You should use type casting in your Task function to use the parameters. Example of this:
Task{ Fn: func(params []interface{}) { var ( n1 = params[0].(int) n2 = params[1].(int) ) fmt.Printf("Sum: %d", n1+n2) }, Params: []interface{}{5, 5} }
Click to show internal directories.
Click to hide internal directories.