mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 10:49:16 +08:00
14 lines
294 B
Python
14 lines
294 B
Python
"""
|
|
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
|