本节内容: RabbitMQ队列 Memcached Redis 1. RabbitMQ 安装 http://www.rabbitmq.com/install-standalone-mac.html 安装python rabbitMQ module pip install pika or easy_install pika or 源码 https://pypi.python.org/pypi/pika 实现最简单的队列 send 端 received 端 1.1 Work Queues 在这…
线程池 简单的线程池的实现: import queue import threading import time class ThreadPool(object): def __init__(self, max_num=20): self.queue = queue.Queue(max_num) for i in range(max_num): self.queue.put(threading.Thread) def get_thread(self): return self.queue.get…