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
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 = {}
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
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()