Skip to content
Skills Library
Programming · Building & coding

async

/async

Architecture async-first avec messaging et queues (Symfony Messenger, Laravel Queue, Ecotone). Use when working with async processing, queues, workers, background jobs.

Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Architecture async-first avec messaging et queues (Symfony Messenger, Laravel Queue, Ecotone). Use when working with async processing, queues, workers, background jobs.

Original author description

Architecture async-first avec messaging et queues (Symfony Messenger, Laravel Queue, Ecotone). Use when working with async processing, queues, workers, background jobs.

How it works

  1. Quand activer l'async
  2. Cinq invariants non-négociables
  3. Frameworks recommandés
  4. Pattern minimal (Symfony Messenger)
  5. Anti-patterns critiques
  6. Documenter les contrats de messages
  7. Pour aller plus loin
Original SKILL.md headings · 74 lines, 405 words
SKILL.md preview
---
name: async
description: Architecture async-first avec messaging et queues (Symfony Messenger, Laravel Queue, Ecotone). Use when working with async processing, queues, workers, background jobs.
context: fork
  files: ["config/packages/messenger.yaml", "config/queue.php", "app/Jobs/**", "src/Message/**", "src/MessageHandler/**"]
---

# Async-First — Quick Reference

Décharger les traitements > 200 ms vers des workers en arrière-plan, pour garder l'UI/API réactives.

## Quand activer l'async

| Cas | Async ? |
|-----|---------|
| Envoi d'email transactionnel | ✅ |
| Génération PDF / export CSV | ✅ |
| Appel API tierce > 200 ms | ✅ |
| Traitement batch nocturne | ✅ |
| Lecture base de données triviale | ❌ |

## Cinq invariants non-négociables

1. **HTTP < 200 ms.** Toute opération qui dépasse ce seuil doit être déportée.
2. **Idempotence obligatoire.** Un message peut être rejoué — concevoir comme tel (idempotency keys, dedupe).
3. **Retry + Dead Letter Queue.** 3 tentatives, backoff exponentiel + jitter. Au-delà → DLQ + alerte.
4. **Competing consumers.** 4-8 workers en parallèle pour absorber les pics.
5. **Lifecycle tracking.** Logs structurés, métriques (latence, taux erreur, DLQ depth) et alertes.

## Frameworks recommandés

| Stack | Framework | Notes |
|-------|-----------|-------|
| Symfony | **Symfony Messenger** | Transport AMQP, Redis, Doctrine ; supports Stamps |
| Laravel | **Laravel Queue** (Horizon en prod) | Backed by Redis ou SQS ; supervision native |
| PHP framework-agnostic | **Ecotone** | DDD, sagas, scheduler, messaging unifié |
| Node.js | BullMQ ou RabbitMQ | Redis-backed avec dashboard |

## Pattern minimal (Symfony Messenger)

```php
// Message (immutable DTO)
final class SendWelcomeEmail
{
    public function __construct(public readonly string $userId) {}
}

// Handler
final class SendWelcomeEmailHandler
{
    public function __invoke(SendWelcomeEmail $message): void
    {
        // Idempotency check
        if ($this->emailLog->wasSent($message->userId, 'welcome')) {
            return;
        }
        $this->mailer->sendWelcome($message->userId);
        $this->emailLog->record($message->userId, 'welcome');
    }
}

// Dispatch (controller)
$this->bus->dispatch(new SendWelcomeEmail($user->id));
```

## Anti-patterns critiques

- ❌ Mettre une opération idempotente directement dans le handler sans clé d'idempotency (replay = double effet).
- ❌ `try { ... } catch (\Throwable) { /* swallow */ }` dans un handler → le message est marqué traité alors qu'il a échoué.
- ❌ Stocker la payload complète d'un email/PDF dans le message → préférer un ID + lookup, sinon RabbitMQ explose.
- ❌ Pas de circuit breaker autour des appels tiers : un provider down fait monter la DLQ en flèche.

## Documenter les contrats de messages

Si des messages sont consommés par d'autres systèmes/équipes, les décrire avec **AsyncAPI 3.x** (3.1.0 courante, https://www.asyncapi.com/docs/reference/specification/latest) — l'équivalent d'OpenAPI pour les APIs événementielles.

## Pour aller plus loin

> Détails complets, patterns Laravel/Ecotone, exemples de configuration, observabilité OpenTelemetry, lifecycle events, checklists par phase : voir `@.claude/skills/async/REFERENCE.md`.
Files in this package (2)
  • REFERENCE.md 11 KB
  • SKILL.md 3 KB

Versions

RepositoryScoreLicence
This page · TheBeardedBearSAS/claude-craft100MIT
flc1125/skills100MIT
onsi/gomega100MIT

Database snapshot: 13.11.2026 · package version a7d11a191df1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100messenger-async
    Use when implementing async processing, CQRS, or event-driven flows in Symfony with the Messenger component — message/handler pairs, transports, routing, retries, failure queues, and the outbox pattern. Use when the task mentions Messenger, message bus, async, queue,…
  • 100laravel-queues
    Use when implementing Laravel 13 background jobs — queue attributes, workers, batching, chaining, middleware, or Queue::route() routing.
  • 100laravel-background-processing
    Build scalable asynchronous workflows using Queues, Jobs, and Events in Laravel. Use when implementing queued jobs, event-driven workflows, or async processing in Laravel.
  • 100laravel-queues
    Laravel 13 queue and job patterns — driver choice, job design (idempotency, ShouldQueue, model serialisation), retry and failure handling, worker scaling, Bus batching and chaining, Horizon when warranted, queue testing. Use when designing async jobs, scheduling background work,…
  • 100laravel-specialist
    Use when building Laravel 10+ applications, architecting Eloquent models with complex relationships, implementing queue systems for async processing, or optimizing API performance.
  • 90FastAPI Background Tasks
    This skill should be used when the user asks to "create background task", "add async job", "implement task queue", "schedule periodic task", "use Celery", "use ARQ", "process async", or mentions background processing, task queues, job scheduling, workers, or async jobs. Provides…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.