MCPcopy Create free account
hub / github.com/MCSLTeam/MCSL2 / _PluginThread

Class _PluginThread

Adapters/PluginThreadPool.py:18–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17
18class _PluginThread(QThread):
19 def __init__(self):
20 super().__init__()
21 self.runFunc = None
22 self.stopFunc = None
23 self.isStop = False
24
25 def registerStartFunc(self, func):
26 self.runFunc = func
27
28 def registerStopFunc(self, func):
29 self.stopFunc = func
30
31 def run(self) -> None:
32 while True:
33 if self.isStop:
34 if self.stopFunc is not None:
35 self.stopFunc()
36 break
37 self.runFunc()
38
39
40class _PluginThreadPool:

Callers 1

registerThreadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected