futures_executor_mixin
Adapted from the Griptape AI Framework documentation.
Bases:
ABCSource Code in griptape/mixins/futures_executor_mixin.py
@define(slots=False, kw_only=True) class FuturesExecutorMixin(ABC): create_futures_executor: Callable[[], futures.Executor] = field( default=Factory(lambda: lambda: futures.ThreadPoolExecutor()), ) _futures_executor: futures.Executor = field( default=Factory( lambda self: self.create_futures_executor(), takes_self=True, ), alias="futures_executor", ) @property def futures_executor(self) -> futures.Executor: self.__raise_deprecation_warning() return self._futures_executor @futures_executor.setter def futures_executor(self, value: futures.Executor) -> None: self.__raise_deprecation_warning() self._futures_executor = value def __raise_deprecation_warning(self) -> None: warnings.warn( "`FuturesExecutorMixin.futures_executor` is deprecated and will be removed in a future release. Use `FuturesExecutorMixin.create_futures_executor` instead.", DeprecationWarning, stacklevel=2, )
_futures_executor = field(default=Factory(lambda self: self.create_futures_executor(), takes_self=True), alias='futures_executor')
class-attribute instance-attributecreate_futures_executor = field(default=Factory(lambda: lambda: futures.ThreadPoolExecutor()))
class-attribute instance-attributefutures_executor
property writable
__raise_deprecation_warning()
Source Code in griptape/mixins/futures_executor_mixin.py
def __raise_deprecation_warning(self) -> None: warnings.warn( "`FuturesExecutorMixin.futures_executor` is deprecated and will be removed in a future release. Use `FuturesExecutorMixin.create_futures_executor` instead.", DeprecationWarning, stacklevel=2, )
- On this page
- __raise_deprecation_warning()
Could this page be better? Report a problem or suggest an addition!