kitty.core.threading_utils module

Threading Utils

class kitty.core.threading_utils.FuncThread(func, *args)[source]

Bases: threading.Thread

FuncThread is a thread wrapper to create thread from a function

__init__(func, *args)[source]
Parameters:
  • func – function to be called in this thread
  • args – arguments for the function
run()[source]

run the the function in this thread’s context

class kitty.core.threading_utils.LoopFuncThread(func, *args)[source]

Bases: threading.Thread

FuncThread is a thread wrapper to create thread from a function

__init__(func, *args)[source]
Parameters:
  • func – function to be call in a loop in this thread
  • args – arguments for the function
run()[source]

run the the function in a loop until stoped

set_func_stop_event(func_stop_event)[source]
Parameters:func_stop_event (Event) – event to signal stop to the _func
stop()[source]

stop the thread, return after thread stopped