Create Async Workers and Jobs with AI
A complete prompt to design and implement async workers and jobs with queuing, retry, monitoring and deployment.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un architecte logiciel spécialisé en systèmes distribués et traitement asynchrone. Conçois une architecture complète de workers et jobs asynchrones pour mon projet.
Contexte du projet :
- Langage/framework : [LANGAGE_ET_FRAMEWORK]
- Système de file d'attente souhaité : [SYSTEME_FILE_ATTENTE] (ex : Redis/BullMQ, RabbitMQ, SQS, Celery, Sidekiq, ou recommande-moi le plus adapté)
- Types de jobs à traiter : [TYPES_DE_JOBS] (ex : envoi d'emails, génération de rapports PDF, traitement d'images, synchronisation API tierce)
- Volume estimé : [VOLUME_ESTIME] jobs par heure
- Contraintes : [CONTRAINTES] (ex : temps max d'exécution, ordre garanti, idempotence requise)
Génère une architecture complète incluant :
- Structure du projet : organisation des fichiers pour les workers, jobs, et configuration
- Définition des jobs : classes/fonctions pour chaque type de job avec typage fort, validation des payloads, et sérialisation
- Configuration des queues : files d'attente séparées par priorité et type, avec configuration de concurrence
- Worker principal : code du worker avec gestion du cycle de vie (démarrage, arrêt gracieux, signaux SIGTERM/SIGINT)
- Mécanisme de retry : stratégie de retry avec backoff exponentiel, dead letter queue, et nombre max de tentatives
- Gestion des erreurs : try/catch structuré, logging contextuel, alerting sur échecs critiques
- Monitoring : métriques clés (jobs en attente, temps de traitement, taux d'échec), healthcheck endpoint
- Scheduling : jobs récurrents/cron avec configuration déclarative
- Tests : exemples de tests unitaires pour les jobs et tests d'intégration pour le workflow complet
- Déploiement : Dockerfile pour le worker, configuration de scaling horizontal, variables d'environnement
Pour chaque section, fournis le code complet et commenté, prêt à être utilisé en production. Explique les choix d'architecture et les compromis.
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Why this prompt works
<p>This prompt lets you generate a complete asynchronous processing architecture tailored to your tech stack. By specifying your <strong>language and framework</strong>, queue system and job types, the AI produces production-ready code covering the entire job lifecycle.</p><p>The <strong>key variables to customize</strong> are the queue system (BullMQ for Node.js, Celery for Python, Sidekiq for Ruby) and the job types specific to your business. The estimated volume helps the AI adapt concurrency configuration and scaling recommendations.</p><p>The prompt covers aspects often neglected but critical in production: <strong>graceful worker shutdown</strong> to prevent job loss, <strong>idempotency</strong> to handle retries without side effects, and <strong>dead letter queues</strong> to isolate permanently failed jobs. Use it as a starting point then iterate on each section based on your needs.</p>
Use Cases
Expected Output
A complete architecture with structured source code: typed job definitions, queue configuration with priorities, worker with graceful shutdown, retry mechanism with exponential backoff, monitoring with metrics, deployment Dockerfile, and test examples.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
Be the first to comment on this prompt.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Implement Robust Error Handling in Node.js
Create a professional Node.js error handling architecture with custom error classes, centralized middleware, and monitoring.
Prompt DALL-E to Create a Prototype
Creating visual prototypes is a crucial step in any product design process. Traditionally reserved for designers with specialized tools like Figma or Sketch, this phase can now be accelerated with DALL-E. By generating realistic visual mockups from text descriptions, DALL-E allows entrepreneurs, product managers, and developers to quickly materialize their ideas without advanced graphic skills. Whether you want to visualize a mobile app interface, a physical product, or an architectural concept, DALL-E transforms your descriptions into compelling visual representations. This approach considerably reduces the time between ideation and the first visual iteration, going from several days to a few minutes. The AI-generated prototype then serves as a basis for discussion with stakeholders, investors, or potential users, facilitating the collection of concrete feedback before investing in costly development. Mastering the art of prompting for prototype generation with DALL-E thus becomes a strategic skill for anyone wishing to innovate quickly and effectively.
Documenting existing code
Quickly documenting existing undocumented code
Optimize Slow SQL Queries
Analyze and optimize your slow SQL queries through execution plan analysis and precise index recommendations.