Synchronous API to DelugeRPC ?
Posted: Sat Jan 23, 2010 1:56 pm
Hello everyone,
I'm currently developing a little script for my own purpose that needs to control Deluge. I figured I would use the RPC API, but it's entirely asynchronous, because of its use of Twisted deferreds. I had a look on the interwebs to see if there was a way to wait on deferreds, but couldn't find anything. This is too bad, because having to do asynchronous programming makes my code waaaay more complicated than it needs to be (I pretty much have to code a state machine just to do connect -> get ids -> get status). There used to be a synchronous client, and that was awesome for my purpose, is it still in there somewhere ? I had a look through Deluge sources and couldn't find it.
So I guess my questions are : is there still a synchronous API to the deluge RPC, and if not, is there a way to "make" the deferred API synchronous (even a ugly hack, I don't care, this is not production code) ?
Thanks!
I'm currently developing a little script for my own purpose that needs to control Deluge. I figured I would use the RPC API, but it's entirely asynchronous, because of its use of Twisted deferreds. I had a look on the interwebs to see if there was a way to wait on deferreds, but couldn't find anything. This is too bad, because having to do asynchronous programming makes my code waaaay more complicated than it needs to be (I pretty much have to code a state machine just to do connect -> get ids -> get status). There used to be a synchronous client, and that was awesome for my purpose, is it still in there somewhere ? I had a look through Deluge sources and couldn't find it.
So I guess my questions are : is there still a synchronous API to the deluge RPC, and if not, is there a way to "make" the deferred API synchronous (even a ugly hack, I don't care, this is not production code) ?
Thanks!