feat: Limit concurrent procedure execution in HTTP batches
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start by locating the HTTP batch execution path that uses info.calls.map(async ...), then read the existing server options and tests for ordinary and streaming batches. Add coverage for peak concurrency, default behavior, result ordering, per-call errors, and cancellation with queued calls; done means the opt-in limit applies per batch and streaming behavior stays unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the feature you'd like to request
The server currently starts all procedures in an HTTP batch concurrently through info.calls.map(async ...). The existing maxBatchSize option limits the number of procedures in a batch, but not how many can execute at once.
For example, a batch of 20 database queries can start all 20 concurrently, even when the application would benefit from limiting that to four at a time.
It would be useful to have an opt-in concurrency limit for HTTP batches, so applications can control how many procedures run simultaneously without changing the default behavior.
Describe the solution you'd like to see
Add a configurable concurrency limit for ordinary, non-streaming HTTP batches. For example, a server-side option could allow a batch to run at most four procedures at a time, with the remaining calls waiting until a slot becomes available.
The limit should apply per batch, not across all incoming requests. Existing behavior should remain unchanged when the option isn't set.
The implementation should preserve result indices and existing per-call error handling. If a request is cancelled, queued procedures must not start, and running procedures should receive cancellation through the existing AbortSignal.
For the initial implementation, streaming batches can remain unchanged, since long-lived procedures need different concurrency semantics.
Tests should cover peak concurrency, default behavior, out-of-order completion, per-call errors, and cancellation while calls are waiting in the queue.
Describe alternate solutions
Increasing or decreasing maxBatchSize only changes how many calls can be included in a batch; it doesn't directly control concurrent execution.
Applications can also limit concurrency in individual procedures or rely on database connection pools, but these approaches either require custom logic in application code or limit a different resource. A per-batch limit would provide more direct control over how much work a single HTTP request can start at once.
Additional information
This should be an opt-in change limited to server-side execution of ordinary HTTP batches. It shouldn't introduce a global concurrency limit or change streaming behavior.
The main goal is to let applications protect downstream services from bursts of concurrent work while preserving tRPC's existing batching, response ordering, and error semantics.
👨👧👦 Contributing
- 🙋♂️ Yes, I'd be down to file a PR implementing this feature!
- Lenguaje dominante
- TypeScript
- Estrellas
- 40.8k
- Forks
- 1.7k
- Merge medio
- 1 d 17 min
- PR fusionados (30 d)
- 184
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de trpc/trpc
-
bug: [Docs] Next.js Integration documentation references deprecated prefetch functionsPosiblemente ocupada @mmustafasenoglu la tomó hace 52 días. Abierto🐛 bug: unconfirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
trpc/trpc#7596 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
👋 free for all 📚 documentation / examples next-major/definite
Dificultad 2/5 1-2 días Aptitud para principiantes 74/100
trpc/trpc#4448 · 4 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
feat: ReactQueryOptions doesnt infer select from data selectorsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertonext-major/definite
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
trpc/trpc#7183 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug: when `serializer` in `httpLink` can not return `FormData`, even though tRPC can serialize it when using in `input` directlyPosiblemente ocupada @lucacasonato la tomó hace 260 días. Abierto✅ accepted-PRs-welcome
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
trpc/trpc#7180 · 4 comentarios · 4 reacciones ·
Los mantenedores suelen responder en 1 día
-
feat: Controlling retry behavior of `useSubscription`Quizá libre de nuevo @ArjunCodess la tomó hace 51 días y no hay ningún pull request abierto. Abiertonext-major/definite
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
trpc/trpc#7064 · 4 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Issues similares
-
bug chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
🧩 Docs job fails type-checking `generate-plugin-docs.ts`Posiblemente ocupada @X-Guardian la tomó hoy. Abiertodiscussion
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
envision-erpnext
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
bug sharing & sync
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día