OpenSource For You

How to put it all together

-

So, we have taken a good look at how to make use of message queues. In production, a general set-up would look something like Figure 3. The Web server catering to your applicatio­n’s WUDIfiF FDQ EH RQ RQH sHUYHU DQG yRXU GDWDEDsH RQ DQRWKHU server. Your task manager (like Celery) can be on the same server as the Web applicatio­n. Your broker should be on a different server, so that if something goes wrong with it, your Web server remains safe, and vice-versa. Your workers can be either on the server where the broker is, on a different server, or even on multiple different servers, depending on (for example) the number of tasks or the nature of tasks.

Building usable and responsive Web applicatio­ns is important. We saw how queues can help us with improving responsive­ness and looked at a couple of use-cases where they can be helpful. But the possibilit­ies are endless, not only in Web applicatio­ns, but almost anywhere. We also saw that LW’s QRW DOO WKDW GLIfiFXOW WR sHW XS TXHXHs. YRX FDQ PDNH XsH of queues with simple libraries such as PyRes, or something much more robust like Celery, in just about no time. I hope you found this tutorial useful, and I hope you are already on your way to building some amazing apps.

 ??  ??

Newspapers in English

Newspapers from India