Skip to content

Instantly share code, notes, and snippets.

@agocs
Last active August 29, 2015 14:12
Show Gist options
  • Save agocs/73763d10167a95f3d5dc to your computer and use it in GitHub Desktop.
Save agocs/73763d10167a95f3d5dc to your computer and use it in GitHub Desktop.
Channel example
package main
func main() {
stringChannel = make(chan string)
go sendToZMQ(stringChannel)
stringChannel <- "Hello there"
stringChannel <- "How are you"
stringChannel <- "shopBot.explode(Now)"
}
func sendToZMQ(stringChan chan string) {
for {
stringToSend := <-stringChan
ZeroMQObject.publishOrWhatever(stringToSend)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment