Files
onepilot/frogpilot/third_party/reactivex/observable/startasync.py
T
firestar5683 d0e1db6766 StarPilot
2026-03-22 03:15:05 -05:00

19 lines
409 B
Python

from asyncio import Future
from typing import Callable, TypeVar
from reactivex import Observable, from_future, throw
_T = TypeVar("_T")
def start_async_(function_async: Callable[[], "Future[_T]"]) -> Observable[_T]:
try:
future = function_async()
except Exception as ex: # pylint: disable=broad-except
return throw(ex)
return from_future(future)
__all__ = ["start_async_"]