Last active
August 29, 2015 14:12
-
-
Save tylertreat/65269a28931fb0471b1a to your computer and use it in GitHub Desktop.
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
func start(host string) { | |
pub := NewNSQPeer(host) | |
for i := 0; i < 1000; i++ { | |
message := getMessage() | |
pub.Send(message) | |
} | |
pub.Teardown() | |
} |
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
func start(host string) { | |
sub := NewNSQPeer(host) | |
sub.Subscribe() | |
for { | |
message, _ := sub.Recv() | |
fmt.Println(message) | |
if isDone() { | |
break | |
} | |
} | |
sub.Teardown() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment