Skip to content

Commit

Permalink
Merge pull request #315 from jtacoma/gozmqfix
Browse files Browse the repository at this point in the history
Update Go examples for new gozmq API.
  • Loading branch information
hintjens committed Mar 26, 2013
2 parents 469294a + 0c6a3f9 commit 4ddb7a0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/Go/identity.go
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/Go/lbbroker.go
Expand Up @@ -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())
}

Expand Down
4 changes: 2 additions & 2 deletions examples/Go/mdbroker.go
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/Go/mdcliapi.go
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/Go/mdwrkapi.go
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/Go/ppworker.go
Expand Up @@ -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")

Expand Down

0 comments on commit 4ddb7a0

Please sign in to comment.