Can't run async script
offline opened this issue · 3 comments
offline commented
If main function is a coroutine - it will be never executed
example:
async def main(*args, **kwargs):
loop = asyncio.get_event_loop()
redis = loop.run_until_complete(get_redis_pool(loop))
keys = await redis.keys("moments:*")
print(keys)
prints: RuntimeWarning: coroutine 'main' was never awaited
http://stackoverflow.com/questions/36076619/test-if-function-or-method-is-normal-or-asynchronous
offline commented
because you can only use await keyword only inside async function
lorien commented
Can you just touch me in skype regarding this? :)