Skip to content
Snippets Groups Projects
main.go 270 B
Newer Older
  • Learn to ignore specific revisions
  • package messageworker
    
    import (
    	"fmt"
    	"os"
    
    	zmq "github.com/pebbe/zmq4"
    )
    
    func Run() {
    	worker, _ := zmq.NewSocket(zmq.PULL)
    	defer worker.Close()
    	worker.Connect(os.Getenv("ZEROMQ_WORKER"))
    	for {
    		task, _ := worker.Recv(0)
    		fmt.Println("Processing:", task)
    	}
    }