trulens.core.utils.threading¶
trulens.core.utils.threading
¶
Threading Utilities¶
Classes¶
Thread
¶
Bases: Thread
Thread that wraps target with stack/context tracking.
App components that do not use this thread class might not be properly tracked.
ThreadPoolExecutor
¶
Bases: ThreadPoolExecutor
A ThreadPoolExecutor that keeps track of the stack prior to each thread's invocation.
Apps that do not use this thread pool might not be properly tracked.
TP
¶
Bases: SingletonPerName
Manager of thread pools.
Singleton.
Attributes¶
MAX_THREADS
class-attribute
instance-attribute
¶
MAX_THREADS: int = 128
Maximum number of threads to run concurrently.
DEBUG_TIMEOUT
class-attribute
instance-attribute
¶
How long to wait (seconds) for any task before restarting it.
Functions¶
delete_singleton_by_name
staticmethod
¶
delete_singleton_by_name(
name: str, cls: Optional[Type[SingletonPerName]] = None
)
Delete the singleton instance with the given name.
This can be used for testing to create another singleton.
PARAMETER | DESCRIPTION |
---|---|
name |
The name of the singleton instance to delete.
TYPE:
|
cls |
The class of the singleton instance to delete. If not given, all instances with the given name are deleted.
TYPE:
|
delete_singleton
¶
delete_singleton()
Delete the singleton instance. Can be used for testing to create another singleton.