You can now use the Context:lightuserdata() method to get a light
userdata pointer to the underlying ZeroMQ C context object. On the
receiving end, the zmq.init() function can now take in a light
userdata object, which creates a new Context object wrapper for an
existing C context object.
The main use case for this is to provide an easy way to pass a ZeroMQ
context to another Lua interpreter. The two interpreters (which
presumably would be running in separate threads) can then use ZeroMQ
sockets from this context to communicate with each other.
In this use case, we have to be sure not call zmq_term in the Context
__gc metamethod, since both Lua interpreters would try to do this.
Internally, we keep an additional boolean field that indicates whether
a Context object is responsible for terminating the context. When
created with a light userdata, this will be false. When created
normally, the default is true, but can be overridden.
Now 2.0.8 has been released, I don't see any real need to keep them
there.
Revert "Adding support for zmq 2.0.7 with a hacky preprocessor check"
This reverts commit 9d38da847d.
Now 2.0.8 has been released, I don't see any real need to keep them
there.
Revert "Adding support for zmq 2.0.7 with a hacky preprocessor check"
This reverts commit 9d38da847d.