abstract_thread
module core.threads.abstract_thread
class AbstractThread
Abstract base class for all threads
method __init__
__init__(config: Config) → None
Initialize the thread instance. This does not start the thread but only initializes the instance that triggers the thread to start and stop correctly.
method get_new_thread_object
get_new_thread_object() → Thread
Return a new thread object that is to be started.
method main
main(headless: bool = False) → None
Main entrypoint of the thread. In headless mode, don't write to log files but print to console.
method should_be_running
should_be_running(config: Config) → bool
Based on the config, should the thread be running or not?
method update_thread_state
update_thread_state(new_config: Config) → None
Use self.should_be_running
to determine if the thread should be running or not. If it should be running and it is not running, start the thread. If it should not be running and it is running, stop the thread.