Skip to content

Instantly share code, notes, and snippets.

@phoorichet
Last active April 24, 2017 10:44
Show Gist options
  • Save phoorichet/c0a15303f8b4e52b0c3c5bc3e4a9f179 to your computer and use it in GitHub Desktop.
Save phoorichet/c0a15303f8b4e52b0c3c5bc3e4a9f179 to your computer and use it in GitHub Desktop.
// ...
func main() {
// create fixed size queue
queue := producer(1000)
// create consumers to consume work in the queue
consumerCount := 10
for i := 0; i < consumerCount; i++ {
go consumer(queue, i)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment