Skip to content

[2pt] Document the new "takes_raw_args" function option #2508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #2588
TarantoolBot opened this issue Dec 20, 2021 · 0 comments · Fixed by #2730
Closed
Tracked by #2588

[2pt] Document the new "takes_raw_args" function option #2508

TarantoolBot opened this issue Dec 20, 2021 · 0 comments · Fixed by #2730
Assignees
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Dec 20, 2021

Product: Tarantool
Since: 2.10.0-beta2
Root document:

SME: @ locker

Details

A new function option was added - takes_raw_args:

box.schema.func.create('my_func', {takes_raw_args = true})

If set for a Lua function, the functions arguments will be passed
wrapped in a msgpack object (see msgpack.object()) when the function
is called over IPROTO or by box.func.NAME:call():

local msgpack = require('msgpack')
local my_func = function(mp)
    assert(msgpack.is_object(mp))
    local args = mp:decode() -- array of arguments
end

Using this option might improve performance in case a function forwards
most of its arguments to another instance or writes them to a database,
because it eliminates msgpack decoding in Lua.
Requested by @locker in tarantool/tarantool@d2a0124


Additional comment by @ locker:
The option can be used in any custom function registered in box.schema. If such a function is called via net.box (conn:call) or box.func.call, arguments will be passed wrapped in a msgpack object.

@veod32 veod32 added this to the Estimate [@veod32] milestone Jan 11, 2022
@veod32 veod32 changed the title Document that takes_raw_args function option [3pt] Document the new "takes_raw_args" function option Jan 13, 2022
@veod32 veod32 added server [area] Task relates to Tarantool's server (core) functionality reference [location] Tarantool manual, Reference part feature A new functionality labels Jan 13, 2022
@veod32 veod32 removed this from the Estimate [@veod32] milestone Jan 21, 2022
@veod32 veod32 changed the title [3pt] Document the new "takes_raw_args" function option [2pt] Document the new "takes_raw_args" function option Jan 24, 2022
@veod32 veod32 added the 2sp label Jan 27, 2022
@veod32 veod32 self-assigned this Jan 27, 2022
veod32 added a commit that referenced this issue Mar 1, 2022
@veod32 veod32 linked a pull request Mar 1, 2022 that will close this issue
veod32 added a commit that referenced this issue Mar 1, 2022
veod32 added a commit that referenced this issue Mar 1, 2022
Add a description of the takes_raw_args function option

Closes #2508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants