Exemplo n.º 1
0
 def __init__(self):
     self.__storageCache = None
     self.__lock = threading.RLock()
     self._pools = {'clans': _HttpHostDownloader('ce-ct.worldoftanks.net', 3),
      'clubs': _HttpHostDownloader('ce-ct.worldoftanks.net', 3),
      'custom': threads.ThreadPool(workersLimit=2)}
     return
Exemplo n.º 2
0
 def __init__(self, name, workersLimit, queueLimit=threads.INFINITE_QUEUE_SIZE):
     prefsPath = unicode(BigWorld.wg_getPreferencesFilePath(), 'utf-8', errors='ignore')
     self._prefsDirPath = os.path.normpath(os.path.dirname(prefsPath))
     self.__cacheDir = os.path.normpath(os.path.join(self._prefsDirPath, name))
     _expectDir(self.__cacheDir)
     self.__worker = threads.ThreadPool(workersLimit, queueLimit)
     self.__worker.start()
     self.__db = {}
Exemplo n.º 3
0
    def restartWorker(self, workersLimit, queueLimit=threads.INFINITE_QUEUE_SIZE):
        if self.__worker is None:
            self.__worker = threads.ThreadPool(workersLimit, queueLimit)
            self.__worker.start()
            for storage in self.__db.itervalues():
                storage.setWorker(self.__worker)

        return
Exemplo n.º 4
0
 def __init__(self, workersLimit, queueLimit):
     self.__worker = threads.ThreadPool(workersLimit, queueLimit)
     self.__worker.start()
 def __init__(self, workersLimit, queueLimit=threads.INFINITE_QUEUE_SIZE):
     self.__worker = threads.ThreadPool(workersLimit, queueLimit)
     self.__worker.start()