hi there,
I've just pushed a few examples for my pure-Go implementation of ZeroMQ-4 sockets:
Implemented so far (with tests against the C bindings of pebbe/zmq4):
- pub/sub
- push/pull
- req/rep
Implemented (but not tested yet):
- xpub/xsub
- router/dealer
- pair
Enjoy! (and send PRs )
评论:
Ungoliantsspawn:
jasonmoo:I've been using pebbe/zmq4 for some time now, I greatly appreciate a pure Go version, Thx!
I will be watching your repo closely, cheers!
sbinet:I’m not well versed in zmq but saw inproc wasn’t implemented. Is that something that could be implemented with a channel that satisfied the net interfaces your lib expects?
icholy:yes, definitely. IIRC, that's what go-mangos/mangos (a pure Go implementation of
nanomsg
) is doing.alternatively, and as a short gap solution, one could use either
os.Pipe
ornet.Pipe
.
net.Pipe
already uses a couple ofchan
s already:
sbinet:Sweet! This let's me say goodbye to cgo for one of my projects XD
sbinet:Aha :)
I'll post a few histograms comparing latency between cgo-based transport and pure-Go based transport in my favorite application. Nothing earth shattering, between the pure-Go transport has a better figure of merit.
here is the initial preliminary little study:
https://gist.github.com/sbinet/07b5fa628b5278498eea612a0c4b65c3
nanomsg
: go-mangos/mangoszeromq
: go-zeromq/zmq4czmq
: pebbe/zmq4
and my favorite application:

你好,请教下我在windows或linux,使用zmq4库操作zeromq都无法正常编译运行、报
zheyan这样的错误,你有遇到过吗?