[ANN] zmq3: A Go interface to ZeroMQ version 3.

512 views
Skip to first unread message

Peter Kleiweg

unread,
Mar 2, 2013, 8:47:50 AM3/2/13
to golan...@googlegroups.com

I wasn't satisfied with what is available for working with
ZeroMQ, so I implemented my own package. This is voor ZeroMQ
version 3 only, tested with version 3.2.2.

https://github.com/pebbe/zmq3

Comments welcome.

I could not test the package on Windows. I would like to hear
from others if it compiles. There is one function in particular
that has a windows-specfic implementation, and I'm not sure
about it. If it compiles, it should be fine.

Implementation of the examples from the zguide is still
incomplete, but I'm working on it. See subdir 'examples'.


--
Peter Kleiweg
my Go programming cookbook: http://www.let.rug.nl/~kleiweg/go/

Daniel Bryan

unread,
Mar 2, 2013, 8:19:11 PM3/2/13
to golan...@googlegroups.com
Peter,

This looks good. I've been using https://github.com/alecthomas/gozmq, but I wasn't too happy with it.

I particularly like the links to the core zmq API.

One thing I did like about Alec Thomas' version was the exported Socket being an interface type; yours is a struct with no exported fields, so you'd lose nothing from an interface type. It's great when developing to be able to browse to the interface type in godoc and see all the available methods right there. Something to consider. It makes sense with a reasonably complex API like ZMQ sockets.

Still, great work so far. I'll be considering moving some of my projects over to your library.

Peter Kleiweg

unread,
Mar 3, 2013, 8:07:10 PM3/3/13
to golan...@googlegroups.com
I just changed the central part of the API. I hope nobody has used this much yet. It is still young. 

Peter Kleiweg

unread,
Mar 7, 2013, 6:55:59 PM3/7/13
to golan...@googlegroups.com

I just uploaded a major update of my zmq3 package.

https://github.com/pebbe/zmq3

Since the first implementation, I have been working through the
examples in the Zguide, re-implementing each in Go, partly as a
test of the package.

And I ran into a problem. In the beginning, I didn't implement
polling. I figured, you can have the same affect with
goroutines, handling multiple sockets at the same time. It turns
out, you can't, not if you access the same socket from different
goroutines at the same time, because a 0MQ socket is not
thread-safe.

So now I have implemented polling, and I rewrote all examples I
had so far, that used groutines for accessing sockets.

There are now 31 examples. I still intend to implemented all
examples from the Zguide.

I also added a few higher level functions, for reading and
writing multi-part messages.

Rory McGuire

unread,
Mar 11, 2013, 6:48:50 AM3/11/13
to golan...@googlegroups.com
Nice. Thanks. Hope to play with this sometime.
Reply all
Reply to author
Forward
0 new messages