lestrrat-p5 / ZMQ

libzmq Perl binding
46 stars 31 forks source link

ZMQ::Constants missing ZMQ3 context option constants #41

Closed calid closed 8 years ago

calid commented 11 years ago

Please add ZMQ_IO_THREADS=1 and ZMQ_MAX_SOCKETS=2

calid commented 11 years ago

It also looks like a lot of socket option constants are missing, for example all the ZMQTCP* options

lestrrat commented 11 years ago

pullreqs welcome. Make sure you know which versions of libzmq supports them.

calid commented 11 years ago

I took a look at the module, but it seems overly complex. Why not just have a single module with all the constants exported? Who cares what version they're in?

I spoke to the zeromq guys and they said it's a reasonable assumption that user facing constants will retain their distinct values across versions (even if they're added/removed). In fact, Pieter Hintjens added a note clarifying this expectation in zmq.h: https://github.com/zeromq/libzmq/commit/d37d32fb0c9f7987669c2fdb23c81124e3557fed

This being the case, I've generated a version of ZMQ::Constants with all constants from oldest v2 to latest v3 stable, and removed all the plumbing around distinguishing and registering constants with versions. This way it's simply necessary to regenerate and publish each time a new libzmq stable is released, which can be automated.

If you agree with this I'll create a pull request with the generated module and the generation script.

lestrrat commented 11 years ago

Well, the reason there's all that plumbing is because there were massive amounts of SH*T. The APIs/constants in libzmq 2 ~ 3 were a mess. They changed apis and constants so regularly, I had an extremely pleasant time distinguishing what goes where. I personally don't trust the libzmq guys as far as consistency goes, especially with a message they just stuck 12 hours ago.

That being said, I'm not against re-org. But I'm not going to say yes/no without looking at any code.