Skip to content
Snippets Groups Projects
  • Kirill Shcherbatov's avatar
    707e58a3
    box: rework box_lua_{call, eval} to use input port · 707e58a3
    Kirill Shcherbatov authored
    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
    707e58a3
    History
    box: rework box_lua_{call, eval} to use input port
    Kirill Shcherbatov authored
    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