|
| 1 | +from class_addressGenerator import FakeAddressGenerator |
| 2 | +from class_singleWorker import MockSingleWorker |
| 3 | +from class_objectProcessor import MockObjectProcessor |
| 4 | +from inventory import MockInventory |
| 5 | + |
| 6 | + |
1 | 7 | def main():
|
2 | 8 | """Mock main function"""
|
3 |
| - pass |
| 9 | + def start(self): |
| 10 | + """Start main application""" |
| 11 | + # pylint: disable=too-many-statements,too-many-branches,too-many-locals |
| 12 | + |
| 13 | + config = BMConfigParser() |
| 14 | + daemon = config.safeGetBoolean('bitmessagesettings', 'daemon') |
| 15 | + |
| 16 | + # Start the address generation thread |
| 17 | + addressGeneratorThread = addressGenerator() |
| 18 | + # close the main program even if there are threads left |
| 19 | + addressGeneratorThread.daemon = True |
| 20 | + addressGeneratorThread.start() |
| 21 | + |
| 22 | + # Start the thread that calculates POWs |
| 23 | + singleWorkerThread = MockSingleWorker() |
| 24 | + # close the main program even if there are threads left |
| 25 | + singleWorkerThread.daemon = True |
| 26 | + singleWorkerThread.start() |
| 27 | + |
| 28 | + # Start the thread that calculates POWs |
| 29 | + objectProcessorThread = MockObjectProcessor() |
| 30 | + # DON'T close the main program even the thread remains. |
| 31 | + # This thread checks the shutdown variable after processing |
| 32 | + # each object. |
| 33 | + objectProcessorThread.daemon = False |
| 34 | + objectProcessorThread.start() |
| 35 | + |
| 36 | + MockInventory() # init |
0 commit comments