TargetProcess / signalr-client-py

python client proxy for signalr
Other
63 stars 58 forks source link

Stop the wait #17

Open ibrido90 opened 8 years ago

ibrido90 commented 8 years ago

Hi i have looked much into your code and still i can't find a way to stop the waiting process. For example: `def my_cb():

do something`

#......some stuff myhub.client.on('anything',my_cb) myhub.server.invoke('send',data) connection.wait(1000) myhub.server.invoke('send',data)

Of course (and hopefully) I see running _mycb after a second, but before executing the next line i have to wait 999 more seconds which is unacceptable. I'd wish to say into _mycb that when it's fired, or at the end of it, to stop waiting. Is there a way to do this?

Johnathon332 commented 8 years ago

you have connection.wait(1000) you should take this out if you want them to send one after the other without a wait

ibrido90 commented 8 years ago

I think you misunderstood the problematic. I _need _that long wait to get a message from the server. But this message can come after 1 second and so after the execution of the function i'll still wait 999 seconds (and it's wrong). Of course if that message is not received within those 1000 seconds there is no problem because the execution continue to the second send. I hope i was more clear

Johnathon332 commented 8 years ago

when you server gets the first request, get the server to call a method on the client and then invoke another method from the client when you get that response back, this way you won't have to do a connection.wait at all