Page 1 of 1

function sleep problem

Posted: Tuesday 24 July 2018 5:49
by jia175891641
Hi All , I feeled The problem of asynchronous sending is annoying :x
i means python's data send api send data must wait subfunction run over
like this:
...
def test():
sleep(1)
res=funx()
xxx.send("this is test"+res)
sleep(1)
res=funy()
xxx.send("this is test2"+res)

run result (this is not my hope):
sleep 2 second then xxx.send("this is test"+res) and xxx.send("this is test2"+res) almost at the same time :x :x


at windos i tryed import ulrlib.request lib and Solveed this problem
but PRi not supprt this lib (dnpwwo told me) . unfortunately my products run at PRi .
is any good way to Solve this problem?
user code in onconnect function i think is Not beautiful and not good to use
subprocess lib is the only way ? :?:

Re: function sleep problem

Posted: Wednesday 25 July 2018 4:52
by jia175891641
use subprocess.call() Is it the right way to solve the problem?
Look forward to your answer