From: Peter van Dijk Date: Tue, 1 Feb 2022 10:29:20 +0000 (+0100) Subject: dnsdist: docs for newThread&friends X-Git-Tag: auth-4.7.0-alpha1~29^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=be7a8b4c14d9fbed5f2123b5320bf273abc237ab;p=thirdparty%2Fpdns.git dnsdist: docs for newThread&friends --- diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 1b8fe796f7..b183993016 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -1685,6 +1685,7 @@ Thessalonikefs Thiago thinko Thomassen +threadmessage threadsafe throttlemap thrysoee diff --git a/pdns/dnsdistdist/docs/reference/config.rst b/pdns/dnsdistdist/docs/reference/config.rst index 24fe011606..c74ab9e21b 100644 --- a/pdns/dnsdistdist/docs/reference/config.rst +++ b/pdns/dnsdistdist/docs/reference/config.rst @@ -1596,6 +1596,29 @@ Other functions If this function exists, it is called every second to do regular tasks. This can be used for e.g. :doc:`Dynamic Blocks <../guides/dynblocks>`. +.. function:: threadmessage(cmd, dict) + + .. versionadded:: 1.7.0 + + This function, if it exists, is called when a separate thread (made with :func:`newThread`) calls :func:`submitToMainThread`. + +.. function:: newThread(code) + + .. versionadded:: 1.7.0 + + Spawns a separate thread running the supplied code. + Code is supplied as a string, not as a function object. + +.. function:: submitToMainThread(cmd, dict) + + .. versionadded:: 1.7.0 + + Must be called from a separate thread (made with :func:`newThread`), submits data to the main thread by calling :func:`threadmessage` in it. + If no ``threadmessage`` receiver is present in the main thread, ``submitToMainThread`` logs an error but returns normally. + + The ``cmd`` argument is a string. + The ``dict`` argument is a Lua table. + .. function:: setAllowEmptyResponse() .. versionadded:: 1.4.0