From: Petr Špaček Date: Thu, 22 Oct 2020 11:15:50 +0000 (+0200) Subject: map: document internal use X-Git-Tag: v5.2.0~6^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc650754c4faa72e9273c47064565a2a3240413b;p=thirdparty%2Fknot-resolver.git map: document internal use --- diff --git a/daemon/lua/sandbox.lua.in b/daemon/lua/sandbox.lua.in index f7c2afd38..fbb282435 100644 --- a/daemon/lua/sandbox.lua.in +++ b/daemon/lua/sandbox.lua.in @@ -738,6 +738,19 @@ local function map_send_recv(cmd, path) return ret end +-- internal use only +-- Call cmd on each instance via control sockets. +-- @param format - "luaobj" if individual results should be Lua objects +-- - "strings" for eval_cmd output for each instance +-- @returns table with results, one item per instance + key n=number of instances +-- (order of return values is undefined) +-- @throws Lua error if: +-- - communication failed in the middle of trasaction +-- - a result is not serializable +-- - individual call throws an error +-- - number of return values != 1 per instance per call +-- - cmd execution state is undefined after an error +-- Connection errors at the beginning are ignored to paper over leftover dead sockets. function map(cmd, format) local local_sockets = {} local results = {}