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

NikolayMakhonin / time-limits / #9

pending completion
#9

push

NikolayMakhonin
v0.0.8

228 of 297 branches covered (76.77%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

494 of 578 relevant lines covered (85.47%)

106373.33 hits per line

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

14.29
/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
import {toFuncWithFinally} from '@flemist/async-utils'
1✔
5

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

×
16
export async function runPoolWait<T>({
1✔
17
  pool,
×
18
  count,
19
  func,
20
  priority,
21
  abortSignal,
22
  awaitPriority,
×
23
}: PoolRunWaitArgs<T>): Promise<T> {
24
  return toFuncWithFinally(
×
25
    async function funcWithPoolThrow() {
26
      await pool.holdWait(count, priority, abortSignal, awaitPriority)
×
27
      const holdPool = new Pool(count)
×
28
      return func(holdPool, abortSignal)
×
29
    },
30
    () => {
31
      void pool.release(count)
×
32
    },
33
  )()
34
}
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