Take the 2-minute tour ×

I'm looking on example at https://alchimia.readthedocs.org/en/latest/ but have a issue: How i can return result from other function, which using async API with DB?

It will be something like that:

def FindNames():
    result = yield engine.execute(users.select(users.c.name.startswith("D")))
    return result  

def processingResult():
    result = FindNames()
    d_users = yield result.fetchall()
    for user in d_users:
        print "Username: %s" % user[users.c.name]
share|improve this question
Just add yield before FindNames() and use returnValue(result) instead of return result. btw, @inlineCallbacks is not optional here. –  J.F. Sebastian Feb 19 at 21:39

Your Answer



Browse other questions tagged or ask your own question.