caikit.core.toolkit.concurrency.destroyable

Common interface for destroyable threads and processes

Classes

Destroyable

Helper class that provides a standard way to create an ABC using

Module Contents

class caikit.core.toolkit.concurrency.destroyable.Destroyable[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

__doc__ = Multiline-String
Show Value
"""
Common interface for destroyable threads and processes
"""
property destroyed: bool
Abstractmethod:

Return True if destroy was called, regardless of whether the destroyable was alive at the time

property canceled: bool
Abstractmethod:

Returns True if destroyed while actively working

property ran: bool
Abstractmethod:

Return True if the destroyable completed execution in any state

property threw: bool
Abstractmethod:

Return True if any exception was raised during execution

abstract get_or_throw() Any[source]

Get the result of the execution or raise an error if one occurred

abstract destroy()[source]

Cancel any in-progress work

property error: Exception | None
Abstractmethod:

Return the error information to user if one occurred