mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 15:35:47 +08:00
Rate limit asyncio actor (#6242)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user