Skip to content

dependencies for roles #3883

Closed
Closed
@TarantoolBot

Description

@TarantoolBot

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions