Fusing Rust into Flask and Celery
We will fuse Rust into our Flask application by installing our Rust Fibonacci calculation library using pip
. We will then use it in our views and Celery tasks. This will speed up our Flask application without us having to make big changes to our infrastructure. To achieve this, we will carry out the following steps:
- Define our dependency on the Rust Fibonacci number calculation package.
- Build our calculation module with Rust.
- Create a calculation view using Rust in our Flask application.
- Insert Rust into our Celery task.
With this, we will have a Flask application that has a speedup due to Rust. Let's get started!
Defining our dependency on the Rust Fibonacci number calculation package
When it comes to our Rust dependency, it would be tempting to just put our Rust dependency in our requirements.txt
file. However, this can become confusing. Also, we are using an automated process to update our requirements.txt
file...