No more shared.daemon variable #1095

Merged
g1itch merged 1 commits from daemon into v0.6 2018-01-25 13:12:33 +01:00
g1itch commented 2018-01-25 12:15:37 +01:00 (Migrated from github.com)

Hey, I did what you suggested in #1060. There is also daemon variables in other classes:

$ grep -Er 'daemon ?=' src | grep -v thisapp | grep -v singleinstance
src/class_outgoingSynSender.py:                rd.daemon = True  # close the main program even if there are threads left
src/bitmessagemain.py:        daemon = BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon')
src/bitmessagemain.py:                daemon = True
src/bitmessagemain.py:        addressGeneratorThread.daemon = True  # close the main program even if there are threads left
src/bitmessagemain.py:        singleWorkerThread.daemon = True  # close the main program even if there are threads left
src/bitmessagemain.py:        sqlLookup.daemon = False  # DON'T close the main program even if there are threads left. The closeEvent should command this thread to exit gracefully.
src/bitmessagemain.py:        objectProcessorThread.daemon = False  # DON'T close the main program even the thread remains. This thread checks the shutdown variable after processing each object.
src/bitmessagemain.py:        singleCleanerThread.daemon = True  # close the main program even if there are threads left
src/bitmessagemain.py:            singleAPIThread.daemon = True  # close the main program even if there are threads left
src/bitmessagemain.py:        asyncoreThread.daemon = True
src/bitmessagemain.py:            receiveQueueThread.daemon = True
src/bitmessagemain.py:        announceThread.daemon = True
src/bitmessagemain.py:        state.invThread.daemon = True
src/bitmessagemain.py:        state.addrThread.daemon = True
src/bitmessagemain.py:        state.downloadThread.daemon = True
src/bitmessagemain.py:        if daemon == False and BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon') == False:
src/tr.py:        is_daemon = False
src/bitmessagecli.py:            daemon = userInput("Daemon mode Enabled? (True) or (False)").lower()
src/bitmessagecli.py:    daemon = BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon')
src/bitmessagecli.py:    print '     daemon = ' + str(daemon)
src/class_singleListener.py:            rd.daemon = True  # close the main program even if there are threads left
src/class_sendDataThread.py:        self.objectHashHolderInstance.daemon = True

I see it's been set but cannot find where it used.

$ grep -r 'self.daemon' src | grep -v singleinstance
src/bitmessagemain.py:            self.daemonize()
Hey, I did what you suggested in #1060. There is also `daemon` variables in other classes: ```sh $ grep -Er 'daemon ?=' src | grep -v thisapp | grep -v singleinstance src/class_outgoingSynSender.py: rd.daemon = True # close the main program even if there are threads left src/bitmessagemain.py: daemon = BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon') src/bitmessagemain.py: daemon = True src/bitmessagemain.py: addressGeneratorThread.daemon = True # close the main program even if there are threads left src/bitmessagemain.py: singleWorkerThread.daemon = True # close the main program even if there are threads left src/bitmessagemain.py: sqlLookup.daemon = False # DON'T close the main program even if there are threads left. The closeEvent should command this thread to exit gracefully. src/bitmessagemain.py: objectProcessorThread.daemon = False # DON'T close the main program even the thread remains. This thread checks the shutdown variable after processing each object. src/bitmessagemain.py: singleCleanerThread.daemon = True # close the main program even if there are threads left src/bitmessagemain.py: singleAPIThread.daemon = True # close the main program even if there are threads left src/bitmessagemain.py: asyncoreThread.daemon = True src/bitmessagemain.py: receiveQueueThread.daemon = True src/bitmessagemain.py: announceThread.daemon = True src/bitmessagemain.py: state.invThread.daemon = True src/bitmessagemain.py: state.addrThread.daemon = True src/bitmessagemain.py: state.downloadThread.daemon = True src/bitmessagemain.py: if daemon == False and BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon') == False: src/tr.py: is_daemon = False src/bitmessagecli.py: daemon = userInput("Daemon mode Enabled? (True) or (False)").lower() src/bitmessagecli.py: daemon = BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon') src/bitmessagecli.py: print ' daemon = ' + str(daemon) src/class_singleListener.py: rd.daemon = True # close the main program even if there are threads left src/class_sendDataThread.py: self.objectHashHolderInstance.daemon = True ``` I see it's been set but cannot find where it used. ```sh $ grep -r 'self.daemon' src | grep -v singleinstance src/bitmessagemain.py: self.daemonize() ```
PeterSurda commented 2018-01-25 13:10:10 +01:00 (Migrated from github.com)

The thread.daemon is a part of the threading module, telling python that upon exit the thread should be auto-reaped (if True). outgoingsynsender, singlelistener and senddatathread are obsolete. Bitmessagecli is a separate process so it doesn't matter.

The thread.daemon is a part of the threading module, telling python that upon exit the thread should be auto-reaped (if True). outgoingsynsender, singlelistener and senddatathread are obsolete. Bitmessagecli is a separate process so it doesn't matter.
This repo is archived. You cannot comment on pull requests.
No description provided.