Implementing an automatic synchronization
Introduction
With a view to permitting the exchange of data between two applications it is necessary to implement an automatic synchronization between the two applications via the commands in the execution python files.
Principle
When the synchronization must be carried out to permit the exchanges of data, the idea is that of creating a synchro.txt file in the python file of the application 1 and to get this synchro.txt file waited in the python file of the application 2 to go on with its execution.
Carrying out a synchronization
Here is the simplified process to carry out a synchronization between two applications :
Phase | State of Problem 1 | State of Problem 2 |
---|---|---|
1 | Execution on going | Execution on going |
2 | Execution on going |
Waiting for a synchro1.txt file Execution stopped |
3 |
Creation of the synchro1.txt file Execution on going |
Resumption of execution Execution on going |
4 |
Waiting for the synchro2.txt file Execution stopped |
Execution on going |
5 | Execution stopped |
File synchro1.txt is deleted Execution on going |
6 |
Resumption of execution Execution on going |
Creation of the synchro2.txt file Execution on going |
7 | Execution on going |
Waiting for the synchro1.txt file Execution stopped |
8 |
File synchro2.txt is deleted Execution on going |
Execution stopped |
9 | Return to phase 3 up to the end of the execution of the two python files (one python file per application) |