Files
ray/python/ray/async_compat.py
T
2019-11-24 11:39:28 -08:00

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