• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NikolayMakhonin / time-limits / #7

pending completion
#7

push

NikolayMakhonin
v0.0.7

228 of 309 branches covered (73.79%)

Branch coverage included in aggregate %.

57 of 57 new or added lines in 5 files covered. (100.0%)

492 of 589 relevant lines covered (83.53%)

104193.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

7.41
/src/pool/poolRunWait.ts
1
import {IPool, Pool} from '~/src'
1✔
2
import {IAbortSignalFast} from '@flemist/abort-controller-fast'
3
import {AwaitPriority, Priority} from '@flemist/priority-queue'
4

×
5
export type PoolRunWaitArgs<T> = {
×
6
  pool: IPool
7
  count: number
×
8
  /** @param holdPool - pool with `count` size, you can use it for nested checks using poolRunThrow */
×
9
  func: (holdPool: IPool, abortSignal?: IAbortSignalFast) => Promise<T> | T
×
10
  priority?: Priority
11
  abortSignal?: IAbortSignalFast
×
12
  awaitPriority?: AwaitPriority
×
13
}
14

×
15
export async function poolRunWait<T>({
1✔
16
  pool,
×
17
  count,
18
  func,
×
19
  priority,
×
20
  abortSignal,
21
  awaitPriority,
×
22
}: PoolRunWaitArgs<T>): Promise<T> {
×
23
  await pool.holdWait(count, priority, abortSignal, awaitPriority)
×
24

25
  try {
×
26
    const holdPool = new Pool(count)
×
27
    const result = await func(holdPool, abortSignal)
×
28
    return result
×
29
  }
30
  finally {
31
    void this._pool.release(count)
×
32
  }
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc