Closed ethanjli closed 3 years ago
@rohanpurohit For this PR, let's merge after you test this to look for any regressions - the backend (both ventserver.simulator
and ventserver.application
) should still behave the same as before this PR.
For records-keeping:
This PR prepares the backend for implementation of the Event Synchronization application-level protocol layer by refactoring the backend's implementation of the State Synchronization protocol layer (but without changing the State Synchronization protocol specification), specifically:
protocols.application.states.Synchronizer
class with a more generalprotocols.application.states.SequentialSender
class with more general functionality and without timing-related functionality, and aprotocols.application.states.TimedSequentialSender
class which wraps aroundSequentialSender
with a constant send interval. Compare to #398, which performed the same refactor but did not provide aTimedSequentialSender
class because the firmware only needed one rootSequentialSender
and one timer, for sending states to the Python backend; while the Python backend requires threeSequentialSenders
and three timers, for sending states to the firmware, the frontend, and the filesystem - so encapsulating timing-related functionality is useful in the Python backend.I have fully removed the unit tests which were written for
states.Synchronizer
. We should hold off on writing unit tests forprotocols.application.states
, as the interfaces of the classes may undergo further changes for implementation of the Event Synchronization protocol layer.