Tutorial by Examples

A simple worker pool implementation: package main import ( "fmt" "sync" ) type job struct { // some fields for your job type } type result struct { // some fields for your result type } func worker(jobs <-chan job, results chan<- result) ...
A job queue that maintains a worker pool, useful for doing things like background processing in web servers: package main import ( "fmt" "runtime" "strconv" "sync" "time" ) // Job - interface for job processing type Job interf...

Page 1 of 1