Skip to content

Andrey-Ved/tasks_example

Repository files navigation

Tasks example

Simple implementation asynchronous tasks (python, Celery, RabbitMQ, Redis)

based on https://github.com/vjanz/python-asynchronous-tasks

Setup & Installation

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

Usage

Start the celery worker

$ celery -A tasks worker -l info --pool=solo

Start app.py

$ python app.py

Note

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

About

Simple implementation asynchronous tasks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages