Exemple #1
0
    def __init__(self, schema, dir=None, procs=2, limitmb=32, batchsize=100, **kw):
        PoolBase.__init__(self, schema, dir=dir)
        self._make_dir()

        self.procs = procs
        self.limitmb = limitmb
        self.jobqueue = Queue(self.procs * 4)
        self.resultqueue = Queue()
        self.tasks = []
        self.buffer = []
        self.bufferlimit = batchsize
Exemple #2
0
 def __init__(self, schema, dir=None, procs=2, limitmb=32, **kw):
     PoolBase.__init__(self, schema, dir=dir)
     
     self.procs = procs
     self.limitmb = limitmb
     
     self.postingqueue = Queue()
     self.resultsqueue = Queue()
     
     self.tasks = [PoolWritingTask(self.schema, self.dir, self.postingqueue,
                                   self.resultsqueue, self.limitmb)
                   for _ in xrange(procs)]
     for task in self.tasks:
         task.start()
Exemple #3
0
    def __init__(self,
                 schema,
                 dir=None,
                 procs=2,
                 limitmb=32,
                 batchsize=100,
                 **kw):
        PoolBase.__init__(self, schema, dir=dir)
        self._make_dir()

        self.procs = procs
        self.limitmb = limitmb
        self.jobqueue = Queue(self.procs * 4)
        self.resultqueue = Queue()
        self.tasks = []
        self.buffer = []
        self.bufferlimit = batchsize