P
💻DeveloppementAdvancedAll AIs

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 :

  1. Structure du projet : organisation des fichiers pour les workers, jobs, et configuration
  2. Définition des jobs : classes/fonctions pour chaque type de job avec typage fort, validation des payloads, et sérialisation
  3. Configuration des queues : files d'attente séparées par priorité et type, avec configuration de concurrence
  4. Worker principal : code du worker avec gestion du cycle de vie (démarrage, arrêt gracieux, signaux SIGTERM/SIGINT)
  5. Mécanisme de retry : stratégie de retry avec backoff exponentiel, dead letter queue, et nombre max de tentatives
  6. Gestion des erreurs : try/catch structuré, logging contextuel, alerting sur échecs critiques
  7. Monitoring : métriques clés (jobs en attente, temps de traitement, taux d'échec), healthcheck endpoint
  8. Scheduling : jobs récurrents/cron avec configuration déclarative
  9. Tests : exemples de tests unitaires pour les jobs et tests d'intégration pour le workflow complet
  10. 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

Set up a background transactional email sending systemCreate an image processing or PDF generation pipelineOrchestrate periodic synchronizations with third-party APIsImplement a reliable and monitored scheduled tasks (cron jobs) system

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 Optimizer

Comments

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

💻DeveloppementBeginnerAll AIs

Audit code for SQL injection

Find and fix SQL injection

0200
💻DeveloppementIntermediateAll AIs

DALL-E Prompt for Documenting Code

Visual code documentation is a powerful lever for improving understanding of software architectures, data flows, and abstract concepts. DALL-E, OpenAI's image generation model, lets you create custom technical illustrations to accompany your documentation: conceptual diagrams, metaphorical representations of design patterns, explanatory visuals for READMEs or internal wikis. Instead of spending hours on design tools, you can generate images in seconds that make your documentation more accessible and engaging. Whether illustrating a microservices architecture, visually representing the lifecycle of an HTTP request, or creating custom icons for your components, DALL-E transforms your text descriptions into professional visual aids. This approach is especially useful for technical teams looking to make their documentation more intuitive without dedicating design resources. Learn how to craft effective prompts to obtain precise technical illustrations consistent with your visual identity.

0198
💻DeveloppementIntermediateAll AIs

Stable Diffusion Prompt for Creating a Chatbot

Stable Diffusion is a particularly powerful AI image-generation tool for creating the visual elements of a chatbot. Whether you are developing a virtual assistant for your website, a customer service application, or a conversational companion, the visual identity of your chatbot plays a crucial role in user engagement. With Stable Diffusion, you can generate professional avatars, expressive icons, mocked-up user interfaces, and illustrations that give a unique personality to your chatbot. A well-designed avatar inspires trust, humanizes the interaction, and reinforces your brand consistency. In this guide, we offer optimized prompts to create all the visual assets needed for your chatbot: from the main avatar portrait to variations of emotional expressions, as well as interface elements like chat bubbles and action buttons. Each prompt has been tested and refined to produce consistent, professional, and ready-to-use results for your chatbot development projects.

0237
💻DeveloppementIntermediateAll AIs

Course Deployment Guide

Course Deployment

0231