Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 962 Bytes

File metadata and controls

32 lines (24 loc) · 962 Bytes

Concurrency queue

← Docs index

Limit how many requests are in flight at once (useful against rate limits):

http: {
  queue: {
    enabled: true,        // default
    concurrency: 6,       // max simultaneous requests (default 10)
    priority: 'fifo',     // 'fifo' (default) or 'lifo'
  },
}

Requests beyond the limit wait their turn. Aborting a queued (not-yet-started) request removes it from the queue and rejects it.

See it live: the example configures http.queue.concurrency: 6examples/react-vite/src/lib/api/api.config.ts. Combined with deduplication, the Feature Lab's "Deduplication (6→1)" burst demonstrates how concurrent traffic is managed.

Advanced: standalone queue utility

import { createQueue } from '@developerehsan/api-client'

See the API reference.