graph-prototype icon indicating copy to clipboard operation
graph-prototype copied to clipboard

Technical Debt: Refactor Block/Scheduler initialisation API and implementation

Open frankosterfeld opened this issue 4 months ago • 0 comments

Currently, Block has a init() function taking arguments, that is called by addBlock/emplaceBlock, and triggers the state machine going from IDLE to INITIALISED state. At the same time, lifecycle::StateMachine is designed so that state changes are triggered via calls to changeStateTo(), which then calls callbacks such as start/stop/pause/reset and, conflicting with Block::init(), init().

It should be reviewed if Block::init() can be refactored in a way where it is not called by addBlock()/emplaceBlock(), but by the state machine, either by addBlock()/emplaceBlock() calling changeStateTo(INITIALISED), or by addBlock()/emplaceBlock() leaving the block in IDLE state, and the scheduler triggering init() instead. For both approaches, the arguments to init() need to be removed.

frankosterfeld avatar Feb 26 '24 09:02 frankosterfeld