box: rework box_lua_{call, eval} to use input port
Re-factor box_lua_call and box_lua_eval so that they don't take call_request. This approach is more scalable: in case of a functional index, the user expects to see a tuple with field names so we should be able to pass not only raw msgpack, but also a tuple to a Lua call so we need an universal way to pass arguments to _call methods. To pass a tuple msgpack introduced a new port_msgpack: the port class with dump_lua method. A new method get_msgpack returns a content of a port as a msgpack data. The lifecycle of the returned value is implementation-specific: it may either be returned directly from the port, in which case the data will stay alive as long as the port is alive, or it may be allocated on the fiber()->gc, in which case the caller is responsible for cleaning up. Needed for #4182, #1260
Showing
- src/box/call.c 46 additions, 11 deletionssrc/box/call.c
- src/box/call.h 0 additions, 4 deletionssrc/box/call.h
- src/box/execute.c 1 addition, 0 deletionssrc/box/execute.c
- src/box/func.c 20 additions, 3 deletionssrc/box/func.c
- src/box/func.h 2 additions, 3 deletionssrc/box/func.h
- src/box/func_def.h 7 additions, 0 deletionssrc/box/func_def.h
- src/box/lua/call.c 41 additions, 30 deletionssrc/box/lua/call.c
- src/box/lua/call.h 6 additions, 2 deletionssrc/box/lua/call.h
- src/box/lua/execute.c 5 additions, 3 deletionssrc/box/lua/execute.c
- src/box/lua/execute.h 3 additions, 1 deletionsrc/box/lua/execute.h
- src/box/lua/misc.cc 17 additions, 2 deletionssrc/box/lua/misc.cc
- src/box/port.c 2 additions, 1 deletionsrc/box/port.c
- src/box/port.h 15 additions, 0 deletionssrc/box/port.h
- src/lib/core/port.h 34 additions, 4 deletionssrc/lib/core/port.h
Loading
Please register or sign in to comment