Bienvenida
Celery 驴Qu茅 es, para qu茅 sirve, c贸mo se usa?
Repositorio del proyecto
Arquitecturas de software basadas en mensajer铆a y colas de tareas
Brokers de tareas: Servidores de mensajer铆a y formas de usarlos
驴Cu谩ndo debemos usar Celery?
Reto: Casos de uso de Celery
Bot de Slack
驴C贸mo funciona un bot?
C贸mo funciona el API de Slack para programaci贸n de bots (y parecidos y diferencias con otros APIs)
驴C贸mo crear un bot reactivo?
Reto: posibles aplicaciones de bots de Slack, buscar ejemplos y entender c贸mo se llevar铆an a cabo
Reto: modificar el bot b谩sico y crear alguno que responda a a alg煤n tipo de petici贸n o muestre algo
Brokers de mensajer铆a
驴Qu茅 es un broker de mensajer铆a y cu谩ndo debe usarse?
Conceptos: mecanismos de publicaci贸n/suscripci贸n. Canales. Intercambiadores
Brokers de mensajer铆a open source
Python con RabbitMQ uso b谩sico de la terminal
Comparaci贸n de diferentes brokers de mensajer铆a para trabajar con Celery
Reto: Crear una peque帽a aplicaci贸n cliente-servidor que use RabbitMQ desde Python
Celery y brokers de mensajer铆a
Creando un entorno de desarrollo para Celery
Instalaci贸n y creaci贸n de un programa b谩sico pub/sub
C贸mo usar Celery para programar un robot de Slack: dise帽o y comienzo de la implementaci贸n
Monitorizaci贸n de tareas
Solucionando problemas
Reto: implementaci贸n y despliegue b谩sico de un bot de Slack
Enrutado de tareas
Conceptos: enrutado de tareas y por qu茅 se necesita
Enrutado manual
Mensajer铆a en Celery: uso de Kombu
Enrutado autom谩tico
Reto: dise帽o de mecanismos de enrutado para un bot de Slack
Integraci贸n y despliegue en la nube
Estructura de mensajes en Celery y resultados de tareas
Tareas peri贸dicas con Celery
Configuraci贸n de sistemas en la nube
Contenedores
Despliegue en un PaaS: Heroku
Uso de Celery con Node.js
Reto: despliegue en la nube (usando cuentas gratuitas)
Conclusiones
Despedida, conclusiones y a d贸nde ir desde aqu铆
You don't have access to this class
Keep learning! Join and start boosting your career
Working with multiple workers in Celery is not only efficient, but necessary to handle tasks of different nature or priority. This strategy allows developers to effectively manage different message queues, assigning specific workers for each type of task.
The use of multiple workers is recommended for:
Workers can be configured to listen to specific messages or queues. Here is a basic example to understand how queue configurations work:
from celery import Celery
app = Celery('tasks', broker='pyamqp://guest@localhost//')
@app.taskdef add(x, y): return x + y
@app.taskdef multiply(x, y): return x * y
app.conf.task_routes = { ' tasks.add': {'queue': 'default'}, ' tasks.multiply': {'queue': 'priority'}
Manual queue management provides additional control over the flow of tasks. Here, the example illustrates how to manually route events between different queues using Celery:
from some_module import process_command
def process_event(event): if event['type'] == 'message' and not event.get('subtype'): process_command.apply_async((event['text'],), queue='commands')
Once the queues and workers have been configured, you can create specific processes to handle those tasks:
celery -A tasks worker --queue=default
celery -A tasks worker --queue=priority
The main benefit of distributed execution lies in the ability to handle multiple tasks concurrently, optimizing resource usage and increasing system resilience. In addition, it allows scalability, both on local servers and on cloud servers.
Imagine that in a cloud application, where data processing is critical, 20 geographically and functionally distributed workers are deployed. This architecture not only improves efficiency, but also minimizes the risk of data or message loss, leveraging the infrastructure to levels previously unattainable with traditional non-distributed architectures.
Be encouraged to continue exploring Celery's capabilities in upcoming lessons, where more advanced routing solutions and other architectural strategies will be covered. 馃帀
Contributions 1
Questions 0
Want to see more contributions, questions and answers from the community?