Skip to Content
Distributed Computing with Python
book

Distributed Computing with Python

by Francesco Pierfederici
April 2016
Intermediate to advanced content levelIntermediate to advanced
170 pages
3h 48m
English
Packt Publishing
Content preview from Distributed Computing with Python

More complex Celery applications

We will implement two simple but interesting applications using Celery. The first one is a reimplementation of the currency exchange rate example from Chapter 3, Parallelism in Python, and the second one is a distributed sort algorithm.

We are going to use a total of four machines again (HOST1, HOST2, HOST3, and HOST4) for all these examples. As we did before, machine one (HOST1) will run RabbitMQ. The second machine (HOST2) will run Redis, the third one (HOST3) will run Celery workers, and finally, the fourth one (HOST4) will run our main code.

Let's start with a simple example. Create a new Python script (celery/currency.py) and write the following code (if you're not using Redis, remember to change backend to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Distributed Machine Learning with Python

Distributed Machine Learning with Python

Guanhua Wang
Scientific Computing with Python - Second Edition

Scientific Computing with Python - Second Edition

Claus Führer, Claus Fuhrer, Jan Erik Solem, Olivier Verdier
Learning Python Networking - Second Edition

Learning Python Networking - Second Edition

José Manuel Ortega, Dr. M. O. Faruque Sarker, Sam Washington

Publisher Resources

ISBN: 9781785889691Supplemental Content