How to synchronize Sikuli scripts on different machines --- try Python sockets

Asked by Aravind

Hi,

In this scenario, I have two machines, machine A & machine B for which I have two batch files A and B respectively where I have included the collections of projects in the same format as :

---------------------------------------------------
@ECHO OFF
REM Runs all my projects

call C:\SikuliX\runIDE.cmd -r D:\MyWorkSpace\p1.sikuli
ECHO Ran project 1
call C:\SikuliX\runIDE.cmd -r D:\MyWorkSpace\p2.sikuli
ECHO Ran project 2
---------------------------------------------------

And the issue here is that project1 in A and project1 in B are related ones project2 in A and project2 in B are related ones and so on. So, is there any mechanism by which I could tell my batch file in the machine A to wait launching project1 until my project1 also starts up in machine B, and vice versa because I need all these combinations(pjct1 in A & pct1 in B, pjct2 in A & pjct2 in B) to be started together.

Or can this sync be done in the Sikuli script itself, but the only thing which I know to pass info between two scripts is an xml-rpc call but if project1 script in A is not yet launched and the project1 script in B is launched, then I cannot make an xml-rpc call from B to A.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Aravind
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

So since you know, how to use XML-RPC for this kind of synch, just insert dummy scripts as needed, that do nothing but wait and terminate on request.

Revision history for this message
Aravind (a4aravind) said :
#2

Thanks Raiman, i just tried using Python sockets for accomplishing my requirement. Like In Machine A suppose the script is started, it opens up a socket and will listen for connections. And as soon as Mcahine B is started it sends some data saying 'I have started ..now we can proceed ;-)'. Now on recieving that data, Machine A will proceed further in sync with Machine B.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Yes, sockets is an easy alternative for just synching.
Good finding.