class documentation

Class representing a thread.

Method __del__ Stop the thread and release its resources.
Method __init__ Initialize the thread.
Method run Run the thread.
Method stop Request the thread to stop.
Class Variable __slots__ Undocumented
Property error Get the error if any occurred during thread execution.
Property is_running Check if the thread is running.
Property should_stop Check if stop was requested.
Method _wrapper Run the target function and capture any error.
Instance Variable _args Undocumented
Instance Variable _error Undocumented
Instance Variable _function Undocumented
Instance Variable _lock Undocumented
Instance Variable _running Undocumented
Instance Variable _stack_size Undocumented
Instance Variable _stop_requested Undocumented
def __del__(self):

Stop the thread and release its resources.

def __init__(self, function: callable, args: tuple = (), stack_size: int = 0):

Initialize the thread.

Parameters
function:callableThe function to run in the thread.
args:tupleArguments to pass to the function. Defaults to ().
stack_size:intThread stack size in bytes. Defaults to 0.
def run(self) -> bool:

Run the thread.

Returns
boolTrue if the thread started, False otherwise.
def stop(self):

Request the thread to stop.

__slots__: tuple[str, ...] =

Undocumented

@property
error =

Get the error if any occurred during thread execution.

@property
is_running: bool =

Check if the thread is running.

@property
should_stop: bool =

Check if stop was requested.

def _wrapper(self):

Run the target function and capture any error.

_args: tuple =

Undocumented

_error =

Undocumented

_function =

Undocumented

_lock =

Undocumented

_running: bool =

Undocumented

_stack_size =

Undocumented

_stop_requested: bool =

Undocumented