31 lines
660 B
Python
31 lines
660 B
Python
import threading
|
|
from lifecycleregistry import registerLifecycle
|
|
from lifecyclemanager import manageLifecycle
|
|
|
|
threadlist = []
|
|
threadnum = 0
|
|
|
|
def buildThread(module, lifecycles):
|
|
global threadnum
|
|
threadnum += 1
|
|
|
|
threadname = f"thread.{threadnum}"
|
|
|
|
thread = threading.Thread(
|
|
target=manageLifecycle,
|
|
args=(module, lifecycles)
|
|
)
|
|
thread.start()
|
|
|
|
registryname = threadname
|
|
registryvalue = thread
|
|
|
|
lifecycles = registerLifecycle (module, lifecycles, registryname, registryvalue)
|
|
|
|
threadlist.append(thread)
|
|
|
|
print(threadlist)
|
|
print(lifecycles)
|
|
|
|
return threadnum, threadname, lifecycles, threadlist
|