summaryrefslogtreecommitdiff
path: root/doc/it
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-05-12 09:25:45 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-05-12 09:25:45 +0200
commit1d3d0aa66e558dc8beb11929349db3754b6591a3 (patch)
tree94699b2ff4a507213b1d1e39018b0eef73dfb132 /doc/it
parenta24817b141f1da76f56db9d034b18365effac37f (diff)
downloadweechat-1d3d0aa66e558dc8beb11929349db3754b6591a3.zip
doc: add chapter about WeeChat architecture in scripting guide
Diffstat (limited to 'doc/it')
-rw-r--r--doc/it/weechat_scripting.it.adoc24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/it/weechat_scripting.it.adoc b/doc/it/weechat_scripting.it.adoc
index fe764689d..d1d9221d9 100644
--- a/doc/it/weechat_scripting.it.adoc
+++ b/doc/it/weechat_scripting.it.adoc
@@ -47,6 +47,30 @@ Quasi tutti gli esempi in questo manuale sono scritti in Python, ma l'API
[[scripts_in_weechat]]
== Script 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
+ <<register_function,register function>>
+* when a hook callback is called by WeeChat (see the chapter <<hooks,Hooks>>).
+
+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 <<hook_process,Eseguire un processo in background>>
+and the documentation on the function `hook_process` in the
+link:weechat_plugin_api.it.html#_hook_process[WeeChat plugin API reference].
+
[[languages_specificities]]
=== Specifiche per i linguaggi