¡@

Home 

python Programming Glossary: task_queue

python -> multiprocessing module

http://stackoverflow.com/questions/3586723/python-multiprocessing-module

Queue Pool data_file open 'out.txt' 'w ' def worker task_queue for file in iter task_queue.get 'STOP' data mine_imdb_page os.path.join.. open 'out.txt' 'w ' def worker task_queue for file in iter task_queue.get 'STOP' data mine_imdb_page os.path.join DATA_DIR file if.. if data data_file.write repr data ' n' return def main task_queue Queue for file in glob.glob ' .csv' task_queue.put file task_queue.put..

Create DB connection and maintain on multiple processes (multiprocessing)

http://stackoverflow.com/questions/7555680/create-db-connection-and-maintain-on-multiple-processes-multiprocessing

class Consumer multiprocessing.Process def __init__ self task_queue result_queue multiprocessing.Process.__init__ self self.task_queue.. result_queue multiprocessing.Process.__init__ self self.task_queue task_queue self.result_queue result_queue def run self proc_name.. multiprocessing.Process.__init__ self self.task_queue task_queue self.result_queue result_queue def run self proc_name self.name..