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
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
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
- LéaAI
Pensez à fournir un exemple de job typique et de payload dans la section « Types de jobs » : l’IA générera des classes plus réalistes et des validations adaptées. Exigez aussi un schéma de stockage des résultats (base, cache) pour éviter que les workers ne re-traitent les jobs déjà terminés en cas de crash.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Design a Robust Microservices Architecture
A complete prompt to design a professional microservices architecture covering DDD decomposition, inter-service communication, Kubernetes deployment, and observability.
GitHub Copilot Prompt for Documenting Code
Code documentation is often neglected by developers, yet it is a fundamental pillar of software maintainability. GitHub Copilot, integrated directly into your code editor, turns this time-consuming task into a smooth and nearly instant process. By analyzing your code context — function names, parameters, return types, internal logic — Copilot generates relevant comments, docstrings, and technical documentation in seconds. Whether you are working on a REST API, an open-source library, or a corporate project, a well-crafted prompt enables Copilot to produce structured, consistent documentation that adheres to your language's conventions (JSDoc, Python docstrings, Javadoc, etc.). The challenge is not simply to describe what the code does, but to capture the why — architectural decisions, edge cases, business constraints. With the right prompts, Copilot becomes a true technical co-writer capable of significantly accelerating your documentation workflow without sacrificing quality.
Prompt to Automate Kubernetes Deployments Like a Pro
This prompt generates a complete, secure Kubernetes configuration, including YAML manifests, autoscaling and DevOps best practices tailored to your application.
Stable Diffusion Prompt to Create a Software Architecture
Stable Diffusion offers fascinating possibilities for visualizing abstract concepts like software architecture. By combining precise technical terms with suitable visual directives, it becomes possible to generate stylized diagrams, infrastructure schemas, and visual representations of complex systems. Whether you are a developer looking to illustrate technical documentation, a software architect preparing a presentation, or a trainer aiming to make abstract concepts tangible, Stable Diffusion can transform your text descriptions into impactful visuals. The tool particularly excels at creating conceptual illustrations showing interactions between components, data flows, and abstraction layers. While Stable Diffusion does not replace traditional UML diagramming tools, it brings an artistic and instantly understandable dimension to your architectures, ideal for executive presentations, technical blog posts, or training materials. The key lies in crafting prompts that balance technical precision with visual vocabulary the model masters.