Rate limit asyncio actor (#6242)

This commit is contained in:
Simon Mo
2019-11-24 11:39:28 -08:00
committed by GitHub
parent 9f0d005ce6
commit aa8d5d2f6c
8 changed files with 163 additions and 18 deletions
+13
View File
@@ -0,0 +1,13 @@
"""
This file should only be imported from Python 3.
It will raise SyntaxError when importing from Python 2.
"""
def sync_to_async(func):
"""Convert a blocking function to async function"""
async def wrapper(*args, **kwargs):
return func(*args, **kwargs)
return wrapper