June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
package pool import ( "context" "fmt" ) // Dispatch creates numWorker workers, returns a cancel // function channels for adding work and responses, // cancel must be called func Dispatch(numWorker int) (context.CancelFunc, chan WorkRequest, chan WorkResponse) { ctx := context.Background() ctx, cancel := context.WithCancel(ctx) in := make(chan WorkRequest, 10) out := make(chan ...