Skip to content

dependencies for roles #3883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TarantoolBot opened this issue Nov 29, 2023 · 1 comment · Fixed by #4221
Closed

dependencies for roles #3883

TarantoolBot opened this issue Nov 29, 2023 · 1 comment · Fixed by #4221
Assignees

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Nov 29, 2023

Related dev. issue(s): tarantool/tarantool#9078
Related doc. issue(s): #3702
Related Cartridge docs: Defining role dependencies

Product: Tarantool
Since: 3.0
Root document:

SME: @ ImeevMA

Details

Roles can now have dependencies. This means that the verify() and
apply() methods will be executed for these roles, taking into account
the dependencies. Dependencies should be written in the "dependencies"
field of the array type. Note, the roles will be loaded (not applied!)
in the same order in which they were specified, i.e. not taking
dependencies into account.

Roles dependencies are specified in a role's code - not in a config:

return {
    dependencies = {'four', 'two'},
    validate = function() end,
    apply = apply,
    stop = function() end,
}

Example:

Dependencies of role A: B, C
Dependencies of role B: D
No other role has dependencies.

Order in which roles were given: [E, C, A, B, D, G]
They will be loaded in the same order: [E, C, A, B, D, G]
The order, in which functions verify() and apply() will be executed:
[E, C, D, B, A, G].
Requested by @ ImeevMA in tarantool/tarantool@7fbc1d0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants