Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this refactoring proposal, a fundamental change has been made to the VM Sync process, we now rely on job scheduling and serializing job execution to make the whole process loose-coupled and easier to handle. Changes between two stationary states (i.e, from Stopped to Running, or from Running to Stopped will always be associated with a transition job, and all jobs operating on the same VM will be executed in order, at one given time, there will be at most one and only one job can be executed upon. From job handling perspective, VM state report appears only be handling trigger event. This means that there will be no central place like compareState that needs to exhaust all handling scenarios.

...

_jobMgr.waitAndCheck relies on the service provided by MessageDetector. To fit into synchronized programming model, MessageDetector will block the execution until an interested event appears on the message bus.

2) Job facility

AsyncJobManagerImpl

Refactor it to decouple the tight link with API jobs, make it generic not only executing async API request jobs but also executing internal VM operating jobs

...