3 ms·
BTW, when writing in Twisted use @inlineCallbacks with yields for async code. The code reads as if it was synchronous then. @inlineCallbacks def get_in
by limaoscarjuliet 8y ago
BTW, when writing in Twisted use @inlineCallbacks with yields for async code. The code reads as if it was synchronous then.
@inlineCallbacks
def get_index_status(self, index_id):
uri = "{}/index-status?id={}".format(self.SERVER, index_id) #yes, no escaping, as this is silly test only
r = yield self.get(uri)
returnValue(r.text)
Using raw Deferreds is a big more difficult.