Neopallium / lua-zmq

Lua zeromq2 binding
http://github.com/Neopallium/lua-zmq
MIT License
151 stars 36 forks source link

Add additional code to each thread's bootstrap logic #10

Closed dcreager closed 13 years ago

dcreager commented 13 years ago

This patch lets you add additional code to the beginning of the bootstrap function executed within each new llthread. This is needed, for instance, if you've installed lua-zmq via luarocks; in this case, you need to require luarocks.loader before you can require zmq. So you can do something like:

if package.loaded["luarocks.loader"] then
   zmq.threads.set_bootstrap_prelude([[require "luarocks.loader"]])
end