Package conduit :: Module Vfs :: Class FolderScannerThreadManager
[hide private]

Class FolderScannerThreadManager

source code


Manages many FolderScanner threads. This involves joining and cancelling said threads, and respecting a maximum num of concurrent threads limit

Instance Methods [hide private]
 
__init__(self, maxConcurrentThreads=2)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
make_thread(self, folderURI, includeHidden, followSymlinks, progressCb, completedCb, *args)
Makes a thread for scanning folderURI.
source code
 
_register_thread_completed(self, sender, folderURI)
Decrements the count of concurrent threads and starts any pending threads if there is space
source code
 
join_all_threads(self)
Joins all threads (blocks)
source code
 
cancel_all_threads(self)
Cancels all threads ASAP.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, maxConcurrentThreads=2)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

make_thread(self, folderURI, includeHidden, followSymlinks, progressCb, completedCb, *args)

source code 
Makes a thread for scanning folderURI. The thread callsback the model at regular intervals with the supplied args

join_all_threads(self)

source code 

Joins all threads (blocks)

Unfortunately we join all the threads do it in a loop to account for join() a non started thread failing. To compensate I time.sleep() to not smoke CPU

cancel_all_threads(self)

source code 
Cancels all threads ASAP. My block for a small period of time because we use our own cancel method