caikit.core.toolkit.concurrency.destroyable =========================================== .. py:module:: caikit.core.toolkit.concurrency.destroyable .. autoapi-nested-parse:: Common interface for destroyable threads and processes Classes ------- .. autoapisummary:: caikit.core.toolkit.concurrency.destroyable.Destroyable Module Contents --------------- .. py:class:: Destroyable Bases: :py:obj:`abc.ABC` Helper class that provides a standard way to create an ABC using inheritance. .. py:attribute:: __doc__ :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Common interface for destroyable threads and processes """ .. raw:: html
.. py:property:: destroyed :type: bool :abstractmethod: Return True if destroy was called, regardless of whether the destroyable was alive at the time .. py:property:: canceled :type: bool :abstractmethod: Returns True if destroyed while actively working .. py:property:: ran :type: bool :abstractmethod: Return True if the destroyable completed execution in any state .. py:property:: threw :type: bool :abstractmethod: Return True if any exception was raised during execution .. py:method:: get_or_throw() -> Any :abstractmethod: Get the result of the execution or raise an error if one occurred .. py:method:: destroy() :abstractmethod: Cancel any in-progress work .. py:property:: error :type: Optional[Exception] :abstractmethod: Return the error information to user if one occurred