]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: docs for newThread&friends 11271/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 1 Feb 2022 10:29:20 +0000 (11:29 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 1 Feb 2022 10:57:45 +0000 (11:57 +0100)
.github/actions/spell-check/expect.txt
pdns/dnsdistdist/docs/reference/config.rst

index 1b8fe796f711270cedf0304129b59b36fb4407db..b183993016d9afdfae042181ee5573c996d84601 100644 (file)
@@ -1685,6 +1685,7 @@ Thessalonikefs
 Thiago
 thinko
 Thomassen
+threadmessage
 threadsafe
 throttlemap
 thrysoee
index 24fe01160606ded00d87c38703a82d8c750d343d..c74ab9e21b350f0d52277dde0bed43a1d145c871 100644 (file)
@@ -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