Skip to content
Browse files

Update Go examples for new gozmq API.

  • Loading branch information...
1 parent 469294a commit 0c6a3f97f4c954675326dc81c4ad4f990745b06d @jtacoma jtacoma committed
View
2 examples/Go/identity.go
@@ -10,7 +10,7 @@ import (
zmq "github.com/alecthomas/gozmq"
)
-func dump(sink zmq.Socket) {
+func dump(sink *zmq.Socket) {
parts, err := sink.RecvMultipart(0)
if err != nil {
fmt.Println(err)
View
2 examples/Go/lbbroker.go
@@ -26,7 +26,7 @@ func randomString() string {
return strings.Join(target, "")
}
-func set_id(socket zmq.Socket) {
+func set_id(socket *zmq.Socket) {
socket.SetSockOptString(zmq.IDENTITY, randomString())
}
View
4 examples/Go/mdbroker.go
@@ -44,10 +44,10 @@ type mdService struct {
}
type mdBroker struct {
- context zmq.Context // Context
+ context *zmq.Context // Context
heartbeatAt time.Time // When to send HEARTBEAT
services map[string]*mdService // Known services
- socket zmq.Socket // Socket for clients & workers
+ socket *zmq.Socket // Socket for clients & workers
waiting *ZList // Idle workers
workers map[string]*mdbWorker // Known workers
verbose bool // Print activity to stdout
View
4 examples/Go/mdcliapi.go
@@ -19,8 +19,8 @@ type Client interface {
type mdClient struct {
broker string
- client zmq.Socket
- context zmq.Context
+ client *zmq.Socket
+ context *zmq.Context
retries int
timeout time.Duration
verbose bool
View
4 examples/Go/mdwrkapi.go
@@ -19,10 +19,10 @@ type Worker interface {
type mdWorker struct {
broker string
- context zmq.Context
+ context *zmq.Context
service string
verbose bool
- worker zmq.Socket
+ worker *zmq.Socket
heartbeat time.Duration
heartbeatAt time.Time
View
2 examples/Go/ppworker.go
@@ -26,7 +26,7 @@ const (
// Helper function that returns a new configured socket
// connected to the Paranoid Pirate queue
-func WorkerSocket(context zmq.Context) zmq.Socket {
+func WorkerSocket(context *zmq.Context) *zmq.Socket {
worker, _ := context.NewSocket(zmq.DEALER)
worker.Connect("tcp://localhost:5556")

0 comments on commit 0c6a3f9

Please sign in to comment.
Something went wrong with that request. Please try again.