有同学问上一篇代码中User-Agent的内容定义怎么来的呢? 简单,祭出我们的法宝:httpfox, 在第一篇中我们说开发要准备好firefo

Read More…

Asynchronous programming with Tornado Tornado is single threaded (in its common usage, although in supports multiple threads in advanced configurations), therefore any “blocking” task will block the whole server. This means that a blocking task will not allow the framework to pick the next task waiting to be processed. The selection of tasks is done by the IOLoop, which, as everything else, runs in the only available thread.

Read More…

There is a new feature in Celery4.x which introduce a Promise like style async method which can retrieve result asynchronicly. But I nerver make it works with RabbitMQ backend or Redis backend, so I dive into source codes to find out why it doesn’t work. When we call AsyncResult.then(on_result_ready), it will do following in celery_root/result.py def then(self, callback, on_error=None, weak=False): self.backend.add_pending_result(self, weak=weak) return self.on_ready.then(callback, on_error) For self.backend.add_pending_result(self, weak=weak), it add myself(AsyncResult instance) into corresponding backend

Read More…