Skip to content

Instantly share code, notes, and snippets.

@miku
Created May 8, 2015 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miku/fc47887018e4531da4d1 to your computer and use it in GitHub Desktop.
Save miku/fc47887018e4531da4d1 to your computer and use it in GitHub Desktop.
NSQ example.
package main
import (
"log"
"github.com/bitly/go-nsq"
)
func main() {
config := nsq.NewConfig()
w, _ := nsq.NewProducer("127.0.0.1:4150", config)
err := w.Publish("write_test", []byte("test"))
if err != nil {
log.Panic("Could not connect")
}
w.Stop()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment