From 1d3d0aa66e558dc8beb11929349db3754b6591a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 12 May 2019 09:25:45 +0200 Subject: doc: add chapter about WeeChat architecture in scripting guide --- doc/de/weechat_scripting.de.adoc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc/de') diff --git a/doc/de/weechat_scripting.de.adoc b/doc/de/weechat_scripting.de.adoc index 352277c37..13ef2f036 100644 --- a/doc/de/weechat_scripting.de.adoc +++ b/doc/de/weechat_scripting.de.adoc @@ -45,6 +45,30 @@ Allerdings ist die API für alle Skriptsprachen nahezu identisch. [[scripts_in_weechat]] == Skripten in WeeChat +// TRANSLATION MISSING +[[weechat_architecture]] +=== WeeChat architecture + +WeeChat is single-threaded, and this applies to scripts as well. + +The code of a script is executed: + +* when the script is loaded: typically a call to the + <> +* when a hook callback is called by WeeChat (see the chapter <>). + +When the code of a script is executed, WeeChat waits for the end of execution +before going on. Therefore the script must *NOT* do blocking operations like +network calls without using a dedicated API function like `hook_process`. + +[IMPORTANT] +A script must *NEVER* fork or create threads without using a dedicated API +function, this can crash WeeChat. + +If something must be run in background, the function `hook_process` can be used. +See example in the chapter <> +and the documentation on the function `hook_process` in the +link:weechat_plugin_api.en.html#_hook_process[WeeChat plugin API reference] (Englisch). + [[languages_specificities]] === Besonderheiten der einzelnen Skriptsprachen -- cgit v1.2.3