Client Concurrency Throttling
Limit the number of simultaneous active HTTP requests to avoid saturating mobile radios, exhausting system sockets, or hitting API rate limits.
Why Mobile Apps Need Request Throttling
On iOS and Android, mobile cellular radios have hardware connection limits. Firing 30 or 50 simultaneous HTTP requests (for instance, when loading an image gallery or dashboard) triggers socket queuing in the OS kernel, causing high latency spikes, packet drops, and thermal throttling.
By setting maxConcurrentRequests, the client manages a FIFO execution queue in JavaScript, ensuring only N requests are active at any single moment:
concurrency.ts
typescript
import { createClient } from 'react-native-fetch-client';
const api = createClient({
baseURL: 'https://api.example.com',
// Limit to at most 4 simultaneous network requests:
maxConcurrentRequests: 4,
});
// Dispatch 50 image requests in parallel:
const fetchJobs = Array.from({ length: 50 }, (_, i) =>
api.get(`/photos/${i}`)
);
// The client allows exactly 4 to run simultaneously.
// As each completes, the next queued request runs automatically.
await Promise.all(fetchJobs);Recommended Setting for Mobile
For most React Native apps on cellular networks, setting
maxConcurrentRequests: 6 or maxConcurrentRequests: 8 provides optimal throughput without overloading device radios or triggering backend 429 rate limit responses.