Source code for ai2_kit.core.future

from typing import Generic, Optional, TypeVar
from abc import abstractmethod


T = TypeVar('T')


[docs] class IFuture(Generic[T]):
[docs] @abstractmethod def done(self) -> bool: pass
[docs] @abstractmethod def result(self, timeout: Optional[float] = None) -> T: pass
[docs] async def result_async(self, timeout: Optional[float] = None) -> T: ...