call: refactor lua CALL/EVAL handling
Currently, we execute a Lua function/expression and dump the result to an output buffer in the same function invoked under lua_cpcall(). Although this allows us to use only one pcall to handle a call request, this also makes box_lua_call() and box_lua_eval() dependent on the iproto format (they have to use iproto_reply_select()), which is ugly. What is worse, the caller has to pass the output buffer right away while in case of iproto it can change if the invoked Lua function yields (iproto switches buffers once in a while to reclaim memory). That being said, we'd better decouple the call itself from the result dump. Let's start from using two pcalls - one for executing the Lua expression and another for dumping arguments - and moving iproto dependent code out of Lua callbacks. Needed for #946
Loading
Please register or sign in to comment