O'Reilly logo

Learning Flask Framework by Charles Leifer, Matt Copperwaite

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous tasks with Celery

Celery is a library that allows you to run asynchronous tasks within Python. This is especially helpful in Python as Python runs single threaded and you may find that you have a long-running task that you wish to either start and discard; or you may wish to give the user of your website some feedback on the progress of the said task.

One such example is e-mail. A user may request an e-mail to be sent, for example a password reset request, and you don't want them waiting for the page to load while the e-mail is generated and sent. We can set this up as a start and discard operation and let the user know that the request is being dealt with.

The way Celery is able to escape the single-threaded environment of Python is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required