Open dvv opened 12 years ago
@dvv, thank-you for your questions!
1) cores will not respawn on death -- they should not die. If a core dies something is wrong. 2) In the future, I would like multiple lev applications to be able to talk to each other. re: security, it might be important to invent some sort of handshaking mechanism or perhaps replace unix domain sockets with something better for IPC.
can we (do we have interface to) pass out-of-band file descriptors to write() calls?
@dvv yes, these are handled by _master[1] and _worker[2]. See net.lua[3] or examples/server-chat.lua[4] for an example on how to use the API.
The interface is exposed via the mbox object.
[1] https://github.com/connectFree/lev/blob/master/lib/lev/_master.lua [2] https://github.com/connectFree/lev/blob/master/lib/lev/_worker.lua [3] https://github.com/connectFree/lev/blob/master/lib/lev/net.lua [4] https://github.com/connectFree/lev/blob/master/examples/server-chat.lua
@dvv specifically, FDs can be sent on IPC pipes via the write method like so:
local fd = 9
ipc_pipe:write("this is data", fd)
FDs can be received on ipc-enabled pipes with this function signature:
ipc_client:read_start(function(c, nread, buf, fd, type)
p("we have received an fd:", fd, "of type:", type)
end)
i'd like to be able to use lev as loadable module. for that, loop initialization etc. must be inside luaopen_levbase
instead of pmain
or alike. since lev_main.c
starts with executing dostring(require('lev'))
in both master and worker mode, this shouldn't be very difficult and is mostly question of moving some code.
can it be done, or it is not feasible? tia
@dvv Lev is using a modified version of LuaJIT, so not all code may be compatible.