If someone could give me a chunk of code showing me how to do something like this I would be super appreciative:
Code: Select all
class SynchronousDelugeRPC(object):
def connect(self,host,port,username,password):
# Connect through client.connect(host,port,username,password) or something like that.
def start(self,hash);
# make a synchronous call... or even to a call back
# something to I suppose client.core.stop(hash) or something like that.
# but how am I supposed to get a response.. or a return value from this... even with a callback... im just going to end up returning a deffered arent i?
def start_callback(self,result)... if you so wished... id prefer to do this without callbacks but I suppose thats unavoidable?
return result
def stop(self):
# make a syncronous call..
# I think you get the point
Any assistance would be super awesome... I have tried for hours to get this working but I am at a loss.
I basically need to be able to do deluge.stop(hash)... deluge.start(hash)... deluge.<other_api_call_here)... and get a response whenever its ready. Just showing me for a basic one is all I need.
Thanks.