Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit 807fe82

Browse files
committed
ref(utils): use python 3.5 asyncio keywords
1 parent fef0129 commit 807fe82

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

rootfs/api/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,14 @@ def async_run(tasks):
171171
executor.shutdown(wait=True)
172172

173173

174-
@asyncio.coroutine
175-
def async_task(params, loop):
174+
async def async_task(params, loop):
176175
"""
177-
performs an async task
176+
Perform a task asynchronously.
178177
"""
179178
# get the calling function
180179
logger.debug('Running {}'.format(params))
181180
# This executes a task in its own thread (in parallel)
182-
yield from loop.run_in_executor(None, params)
181+
await loop.run_in_executor(None, params)
183182
logger.debug('Finished running {}'.format(params))
184183

185184

0 commit comments

Comments
 (0)