asyncio_patterns

Patrones de concurrencia async para ejecutar agentes en paralelo dentro del pipeline KYC

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "asyncio_patterns" with this command: npx skills add davidcastagnetoa/skills/davidcastagnetoa-skills-asyncio-patterns

asyncio_patterns

asyncio y asyncio.gather permiten ejecutar simultáneamente los agentes independientes del pipeline reduciendo el tiempo total en ~50%.

When to use

Usar en el orchestrator_agent cada vez que dos o más agentes puedan ejecutarse en paralelo.

Instructions

  1. Identificar fases paralelas: liveness + doc_capture; OCR + face_match.
  2. Envolver cada llamada de agente como corrutina async.
  3. Usar await asyncio.gather(task_a, task_b, return_exceptions=True).
  4. Gestionar return_exceptions=True: el fallo de un agente no cancela los demás.
  5. Aplicar asyncio.wait_for(coro, timeout=N) a cada tarea para respetar SLO de 8 segundos.
  6. Propagar session_id con contextvars.ContextVar a través de todas las corrutinas.

Notes

  • El GIL no afecta a I/O-bound async, pero sí a CPU-bound. Las tareas CPU-bound deben ejecutarse en ProcessPoolExecutor o delegarse a Celery workers.
  • asyncio.gather no garantiza orden de resultados; indexar por posición o usar diccionario.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

apscheduler_celery_beat

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

gitops_argocd

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

dependabot_renovate

No summary provided by upstream source.

Repository SourceNeeds Review
General

traefik

No summary provided by upstream source.

Repository SourceNeeds Review