Skip to content

Commit 98f2b72

Browse files
committed
Fixes by comments
1 parent b5031ce commit 98f2b72

File tree

1 file changed

+15
-39
lines changed

1 file changed

+15
-39
lines changed

doc/platform/app/app_roles.rst

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,24 @@ As a result, a role module should return an object that has corresponding functi
118118
end,
119119
}
120120
121-
The examples below show how to do this.
121+
The examples in this article show how to do this.
122+
123+
You can omit the optional steps and get a simple role as in the example below.
124+
125+
.. code-block:: lua
126+
127+
return {
128+
validate = function() -- ... -- end,
129+
apply = function() -- ... -- end,
130+
stop = function() -- ... -- end,
131+
}
132+
133+
You can modify a role, for example, by adding dependencies or specifying the on_event callback.
134+
If you modify a role, you need to restart the Tarantool instance with the role in order to apply the changes.
122135

123136
.. NOTE::
124137

125-
Code snippets shown in this section are included from the following application: `application_role_cfg <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/application_role_cfg>`_.
138+
- Code snippets shown in this section are included from the following application: `application_role_cfg <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/application_role_cfg>`_.
126139

127140
.. _roles_create_custom_role_schema:
128141

@@ -179,43 +192,6 @@ In the example below, the ``apply()`` function uses the :ref:`log <log-module>`
179192
:end-before: local function stop
180193
:dedent:
181194

182-
183-
184-
.. _roles_create_custom_role_edit:
185-
186-
Editing a role
187-
~~~~~~~~~~~~~~
188-
189-
Editing a custom application role object means changing the contents of its LUA file. To edit a role object, you can do the following:
190-
191-
* Edit, remove, or set to nil the the role configuration schema;
192-
193-
* Edit, remove, or set to nil dependencies;
194-
195-
* Edit, remove, or set to nil the ``on_event`` callback function;
196-
197-
* Edit the role configuration validation function;
198-
199-
* Edit the apply validation function;
200-
201-
* Edit the stopping role function.
202-
203-
.. code-block:: lua
204-
205-
return {
206-
validate = function() -- ... -- end,
207-
apply = function() -- ... -- end,
208-
stop = function() -- ... -- end,
209-
dependencies = { -- ... -- },
210-
on_event = nil
211-
end,
212-
}
213-
214-
215-
Once the editing of the role object is finished, the :ref:`config:reload() <config_api_reference_reload>` is triggered automatically
216-
to apply the changes. However, if the :ref:`config.reload <configuration_reference_config_reload>` option is set to ``manual``,
217-
then the you must manually perform configuration reload or restart the Tarantool instance with the role.
218-
219195
.. _roles_create_custom_role_stop:
220196

221197
Stopping a role

0 commit comments

Comments
 (0)