Exemple #1
0
    def __init__(self, size, ctor):
        # TODO: high/low water marks
        self.size = size
        self.ctor = ctor
        self.dbque = queue.Queue()

        for i in range(size):
            db = ctor()
            self.putdb(db)
Exemple #2
0
    def __init__(self, pool=0):
        s_eventbus.EventBus.__init__(self)
        self.jobs = {}
        self.pool = pool
        self.onfini(self._finiAllJobs)
        self.onfini(self._finiAllThreads)

        self.jobq = queue.Queue()
        self.threads = []

        self.addPoolWorkers(pool)