diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/de/weechat_scripting.de.adoc | 24 | ||||
-rw-r--r-- | doc/en/weechat_scripting.en.adoc | 23 | ||||
-rw-r--r-- | doc/fr/weechat_scripting.fr.adoc | 27 | ||||
-rw-r--r-- | doc/it/weechat_scripting.it.adoc | 24 | ||||
-rw-r--r-- | doc/ja/weechat_scripting.ja.adoc | 24 | ||||
-rw-r--r-- | doc/pl/weechat_scripting.pl.adoc | 24 |
6 files changed, 146 insertions, 0 deletions
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 + <<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,Hintergrundprozesse>> +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 diff --git a/doc/en/weechat_scripting.en.adoc b/doc/en/weechat_scripting.en.adoc index eebd7ffd0..18a21d9ed 100644 --- a/doc/en/weechat_scripting.en.adoc +++ b/doc/en/weechat_scripting.en.adoc @@ -39,6 +39,29 @@ other languages. [[scripts_in_weechat]] == Scripts in WeeChat +[[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,Run a background process>> +and the documentation on the function `hook_process` in the +link:weechat_plugin_api.en.html#_hook_process[WeeChat plugin API reference]. + [[languages_specificities]] === Languages specificities diff --git a/doc/fr/weechat_scripting.fr.adoc b/doc/fr/weechat_scripting.fr.adoc index 61acecebc..04b7c8f94 100644 --- a/doc/fr/weechat_scripting.fr.adoc +++ b/doc/fr/weechat_scripting.fr.adoc @@ -41,6 +41,33 @@ l'API est la même pour les autres langages. [[scripts_in_weechat]] == Scripts dans WeeChat +[[weechat_architecture]] +=== Architecture de WeeChat + +WeeChat tourne dans un seul thread, et ceci est valable pour les scripts +également. + +Le code d'un script est exécuté : + +* lorsque le script est chargé : typiquement un appel à la + <<register_function,fonction register>> +* lorsque la fonction de rappel d'un "hook" est appelée par WeeChat + (voir le chapitre <<hooks,Hooks>>). + +Lorsque le code du script est exécuté, WeeChat attend la fin de l'exécutio +avant de continuer. Par conséquent, le script ne doit *PAS* faire d'opérations +bloquantes comme des appels réseau sans utiliser une fonction API dédiée +telle que `hook_process`. + +[IMPORTANT] +Un script ne doit *JAMAIS* faire de "fork" ou créer des threads sans utiliser +une fonction dédiée de l'API, cela pourrait provoquer un crash de WeeChat. + +Si quelque chose doit être lancé en arrière-plan, la fonction `hook_process` +peut être utilisée. Voir l'exemple dans le chapitre +<<hook_process,Lancer un processus en tâche de fond>> et la documentation sur +la fonction `hook_process` dans la +link:weechat_plugin_api.en.html#_hook_process[Référence API extension WeeChat]. + [[languages_specificities]] === Spécificités des langages 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 diff --git a/doc/ja/weechat_scripting.ja.adoc b/doc/ja/weechat_scripting.ja.adoc index 9fba9374e..e473cc329 100644 --- a/doc/ja/weechat_scripting.ja.adoc +++ b/doc/ja/weechat_scripting.ja.adoc @@ -45,6 +45,30 @@ WeeChat (Wee Enhanced Environment for Chat) [[scripts_in_weechat]] == 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,フック>>). + +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,バックグラウンドプロセスの実行>> +and the documentation on the function `hook_process` in the +link:weechat_plugin_api.ja.html#_hook_process[WeeChat プラグイン API リファレンス]. + [[languages_specificities]] === 言語仕様 diff --git a/doc/pl/weechat_scripting.pl.adoc b/doc/pl/weechat_scripting.pl.adoc index 76c7b8003..35a366db5 100644 --- a/doc/pl/weechat_scripting.pl.adoc +++ b/doc/pl/weechat_scripting.pl.adoc @@ -45,6 +45,30 @@ ale API jest takie same dla wszystkich języków. [[scripts_in_weechat]] == Skrypty w 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,Wykonuje proces w tle>> +and the documentation on the function `hook_process` in the +link:weechat_plugin_api.en.html#_hook_process[Opisu API wtyczek WeeChat] (Angielski). + [[languages_specificities]] === Specyfika języków |