There are two ways in which the server-side tick_return() differs from the client-side tick() in the StateMachine class; first, the obvious, the server side provides a return value, second, the server side enforces ordering of calls by checking whether the callback requested is the one expected.
It should be possible to fold these two together and would avoid code duplication, which is a bad thing to have in this core part of the logic. There may be other aspects of the way the state machine is coded that should be changed, for example the recursion in case of auto_continue.
Addressed in 657663cc422e1fefe3362939d43b8754a02ae637
Also note that state machine function is now documented here ; state machine is now its own module here and serialization is now enforced (not possible for a tick() call to execute if it's already running).
There are two ways in which the server-side
tick_return()
differs from the client-sidetick()
in theStateMachine
class; first, the obvious, the server side provides a return value, second, the server side enforces ordering of calls by checking whether the callback requested is the one expected.It should be possible to fold these two together and would avoid code duplication, which is a bad thing to have in this core part of the logic. There may be other aspects of the way the state machine is coded that should be changed, for example the recursion in case of
auto_continue
.