You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## ⚡ Max Mode - One Task uses All Available Threads
292
-
293
-
Uses **ALL threads including main thread** for maximum throughput. Same API as turbo, but ~15% faster.
294
-
295
-
```js
296
-
// Same API as turbo
297
-
constsquares=awaitbeeThreads.max(numbers).map(x=> x * x)
298
-
constevens=awaitbeeThreads.max(numbers).filter(x=> x %2===0)
299
-
constsum=awaitbeeThreads.max(numbers).reduce((a, b) => a + b, 0)
300
-
```
301
-
302
-
**Key difference:** Main thread processes data (blocking) while coordinating workers.
303
-
304
-
| Feature |`turbo()`|`max()`|
305
-
|---------|-----------|---------|
306
-
| Main thread blocked | No | Yes |
307
-
| Throughput | Good | Best (~15% faster) |
308
-
| Use in HTTP servers | Yes | Depends |
309
-
| Use in CLI/batch jobs | Yes | Best choice |
310
-
311
-
> **Auto-fallback:** Arrays < 10K items use single-worker mode.
312
-
313
-
---
314
-
315
286
## Request Coalescing
316
287
317
288
Prevents duplicate simultaneous calls from running multiple times. When the same function with identical arguments is called while a previous call is in-flight, subsequent calls share the same Promise.
0 commit comments