Commit Graph

30 Commits (5578612efe296faa36203c7b80507e38fa7714e0)

Author SHA1 Message Date
Aleksey Yeschenko 5578612efe Merge branch 'master' of https://github.com/dcreager/lua-zmq into dcreager-master 16 years ago
Douglas Creager 1b1191a3be Extracting underlying C context object
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.
16 years ago
Robert G. Jakabosky 67909a58de Removed un-needed zmq_return_error() macro. 16 years ago
Robert G. Jakabosky a1141bde7b Changed some of the error messages to match LuaSocket. 16 years ago
Robert G. Jakabosky 993659dd76 Added missing ZMQ_POLL* constants. 16 years ago
Robert G. Jakabosky 3a19588429 Added support for new ZeroMQ 2.1.0 socket options. 16 years ago
Joshua Simmons 03a21804bb Giving lua-zmq new API semantics.
Functions now return nil followed by an error message on failure.
They also fail properly in all cases, this removes asserts from
the code base.
16 years ago
Joshua Simmons 8b961acd05 Removing deprecated UPSTREAM/DOWNSTREAM symbols
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.
16 years ago
Joshua Simmons 08c18e851c Work on object collection
Adding __gc for socket objecs
Adding NULL pointer check to context:term and socket:close
16 years ago
Joshua Simmons c47515af0f Adding __gc metamethod to context 16 years ago
Joshua Simmons 9d38da847d Adding support for zmq 2.0.7 with a hacky preprocessor check 16 years ago
Aleksey Yeschenko e5555d6f38 Renamed ZMQ_UPSTREAM -> ZMQ_PULL, ZMQ_DOWNSTREAM -> ZMQ_PUSH 16 years ago
Aleksey Yeschenko 0fa65dad08 zmq:init(io_threads) 16 years ago
Aleksey Yeschenko 253d931a77 fixed socket options [jugg] 16 years ago
Aleksey Yeschenko f6c1bcb8a8 Renamed s:getsockopt -> s:getopt, s:setsockopt -> s:setopt 16 years ago
Aleksey Yeschenko 3557f6196d Renamed zmq.P2P to zmq.PAIR 16 years ago
Aleksey Yeschenko a7486be0e0 Added support for s:getsockopt(zmq.RCVMORE) and multipart examples 16 years ago
Aleksey Yeschenko 0da82fe130 s:getsockopt 16 years ago
Aleksey Yeschenko b978f857f0 ZMQ_SNDMORE, ZMQ_RCVMORE 16 years ago
Aleksey Yeschenko 237e0c0ea9 Added ZMQ_MORE constant 16 years ago
Aleksey Yeschenko d6a3051596 Added zmq.version() 16 years ago
Aleksey Yeschenko 824b0007d6 Removed s:flush() and NOFLUSH flag 16 years ago
Aleksey Yeschenko 35d6c237e3 Use zmq_errno() 16 years ago
Aleksey Yeschenko c6dc423c94 removed unnecessary lua_pop calls 16 years ago
Aleksey Yeschenko 93ab114d78 set_zmq_const macro 16 years ago
Aleksey Yeschenko 156191ef95 move luaL_register call down 16 years ago
Aleksey Yeschenko 133cf040c6 Object sugar 16 years ago
Aleksey Yeschenko 93adf06b8b cosmetics 16 years ago
Aleksey Yeschenko a860a5a25d License, formatting 16 years ago
Aleksey Yeschenko a71c16425b Initial commit 16 years ago