The DragonBackend class should be refactored to ensure maintainability and readability.
Justification
The DragonBackend class contains some monolithic methods, such as _start_steps and _stop_steps that are deeply nested and complex to read or maintain. The methods manage several queues at the same time, and if new scenarios will arise, it could be difficult to ensure proper handling of workflows.
Implementation Strategy
The refactor should aim at reducing complexity, most likely by adding new single-responsibility objects, and splitting up nested and long methods. Data structures used to represent queues or data (such as _group_infos) should be examined and possibly replaced with thread-safe counterparts.
Description
The
DragonBackend
class should be refactored to ensure maintainability and readability.Justification
The
DragonBackend
class contains some monolithic methods, such as_start_steps
and_stop_steps
that are deeply nested and complex to read or maintain. The methods manage several queues at the same time, and if new scenarios will arise, it could be difficult to ensure proper handling of workflows.Implementation Strategy
The refactor should aim at reducing complexity, most likely by adding new single-responsibility objects, and splitting up nested and long methods. Data structures used to represent queues or data (such as
_group_infos
) should be examined and possibly replaced with thread-safe counterparts.