Skip to content

How I can use it from C++ code? #193

Answered by Totktonada
AndreyAlifanov asked this question in Q&A
Discussion options

You must be logged in to vote

It depends of a nature of this C++ code.

If we're talking about an external process, one should choose a connector and call queue functions using it. Don't forget to grant privileges to execute those functions to your user/role, consider using queue.grant({call = true}). You can look at the list of C/C++ connectors here. At the moment of writting it contains tarantool-c (C) and tntcxx (C++).

If we're about a module (Lua rock) or a stored procedure (registered with box.schema.func.create()) written on C/C++, things are a bit different. We want to call a queue function locally. Lua/C API is for that.

A sketchy code:

int saved_top = lua_gettop(L);

lua_getfield(L, LUA_GLOBALSINDEX, "queue");
l…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@AndreyAlifanov
Comment options

@AndreyAlifanov
Comment options

@Totktonada
Comment options

@AndreyAlifanov
Comment options

@Totktonada
Comment options

Answer selected by Totktonada
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants