Skip to content
Snippets Groups Projects
Commit 11dad290 authored by Georgiy Lebedev's avatar Georgiy Lebedev Committed by Aleksandr Lyapunov
Browse files

core: extend `port_dump_lua` with 'Msgpack object' mode

When data is coming from IPROTO and is passed to Lua, it is convenient to
pass raw MsgPack data (see `box.schema.func::takes_raw_args` option).
Currently, the port's MsgPack is retrieved directly via `port_get_msgpack`
and then a MsgPack object is constructed via `luamp_push`. In the future,
ports can have a MsgPack decoding context that will also be needed to be
passed to the MsgPack object constructor, so we encapsulate the MsgPack
object construction completely into a port method by introducing a new
operation mode to `port_dump_lua`.

This new operation mode is essentially a no-op for a MsgPack port (which is
the case for data coming from IPROTO), and is completely inefficient for
other types of ports (since an intermediate conversion to MsgPack occurs),
but we do not expect users to be calling Lua stored procedures with the
`takes_raw_args` locally. To handle the latter case we introduce a
`port_dump_lua_mp_object_mode_slow` helper function which facilitates
retrieving MsgPack data from ports via region allocation, creating a
Msgpack object and freeing the MsgPack data.

Needed for #8147

NO_CHANGELOG=refactoring
NO_DOC=refactoring
NO_TEST=refactoring
parent d1f1faa1
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment