You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/platform/app/app_roles.rst
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -118,11 +118,24 @@ As a result, a role module should return an object that has corresponding functi
118
118
end,
119
119
}
120
120
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.
122
135
123
136
.. NOTE::
124
137
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>`_.
126
139
127
140
.. _roles_create_custom_role_schema:
128
141
@@ -163,7 +176,6 @@ is used to validate the ``greeting`` value:
163
176
164
177
If the configuration is not valid, ``validate()`` reports an unrecoverable error by throwing an error object.
165
178
166
-
167
179
.. _roles_create_custom_role_apply:
168
180
169
181
Applying a role configuration
@@ -180,8 +192,6 @@ In the example below, the ``apply()`` function uses the :ref:`log <log-module>`
0 commit comments