Last active
August 29, 2015 14:12
-
-
Save agocs/73763d10167a95f3d5dc to your computer and use it in GitHub Desktop.
Channel example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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