github-actions[bot]
Auto-sync from demo at Tue Sep 30 03:30:14 UTC 2025
3a3b216
raw
history blame
341 Bytes
from functools import wraps
from typing import Any, Callable
from .loop import create_event_loop
def async_to_sync_method(func: Callable) -> Callable:
@wraps(func)
def wrapper(self, *args, **kwargs) -> Any:
loop = create_event_loop()
return loop.run_until_complete(func(self, *args, **kwargs))
return wrapper