comparison doc/libervia-cli/pubsub_hook.rst @ 3573:813595f88612

merge changes from main branch
author Goffi <goffi@goffi.org>
date Thu, 17 Jun 2021 13:05:58 +0200
parents 267e4987b58b
children 21e7d46b988c
comparison
equal deleted inserted replaced
3541:888109774673 3573:813595f88612
17 A path to a Python script is expected as argument. The script must contain a ``hook`` 17 A path to a Python script is expected as argument. The script must contain a ``hook``
18 function. 18 function.
19 19
20 ``python_code`` 20 ``python_code``
21 Python code which will be directly executed. 3 variables will be set: ``host`` which 21 Python code which will be directly executed. 3 variables will be set: ``host`` which
22 contain the main SàT instance, ``client`` which contain the session attached to the 22 contain the main Libervia instance, ``client`` which contain the session attached to the
23 profile, and ``item`` which contain the item attached to the event. 23 profile, and ``item`` which contain the item attached to the event.
24 24
25 .. note:: 25 .. note::
26 26
27 Hooks are executed in SàT context, and must be asynchronous. If they block, the whole 27 Hooks are executed in Libervia context, and must be asynchronous. If they block, the whole
28 SàT execution will be blocked. They have access to everything, so don't run a code that 28 Libervia execution will be blocked. They have access to everything, so don't run a code that
29 you don't absolutely trust. 29 you don't absolutely trust.
30 30
31 .. note:: 31 .. note::
32 32
33 Only ``python_file`` type is currently implemented 33 Only ``python_file`` type is currently implemented