Simple implementation asynchronous tasks (python, Celery, RabbitMQ, Redis)
based on https://github.com/vjanz/python-asynchronous-tasks
Create a virtual environment and install the dependencies:
$ python -m venv venv
$ source env/bin/activate
$ pip install -r requirements.txt
Start Redis and RabbitMQ with docker-compose:
docker-compose up -d
Verify that the services are up and running:
$ docker ps
Start the celery worker
$ celery -A tasks worker -l info --pool=solo
Start app.py
$ python app.py
Stop lifted containers:
$ docker-compose stop
Start stopped containers:
$ docker-compose start
Stop and delete containers and network:
$ docker-compose down
Remove Redis image:
$ docker rmi redis
Remove RabbitMQ image:
$ docker rmi rabbitmq