iro/controller/pool.py
branchdevel
changeset 135 f8640c663e3e
parent 132 80a334e2aae7
child 141 90c95fdd1e33
equal deleted inserted replaced
134:fae3fdfece65 135:f8640c663e3e
    14 
    14 
    15     def run(self,f,*args,**kwargs):
    15     def run(self,f,*args,**kwargs):
    16         """To run a function in Twisted's thread pool"""
    16         """To run a function in Twisted's thread pool"""
    17         return threads.deferToThreadPool(self.reactor, self.pool, f, *args, **kwargs)
    17         return threads.deferToThreadPool(self.reactor, self.pool, f, *args, **kwargs)
    18 
    18 
       
    19 #task Pool for sending
    19 taskPool = Pool('task',5)
    20 taskPool = Pool('task',5)
       
    21 
       
    22 #db Pool to handle reqests to sqlalchemy
    20 dbPool = Pool('database',5)
    23 dbPool = Pool('database',5)
    21 
    24 
    22 
    25 # all pools in one list
    23 pools=[taskPool,dbPool]
    26 pools=[taskPool,dbPool]
    24 
    27 
    25 def startPool(reactor):
    28 def startPool(reactor):
    26     '''starting all pools'''
    29     '''starting all pools'''
    27     for pool in pools:
    30     for pool in pools: