MCPcopy Create free account
hub / github.com/Effect-TS/effect / targetSize

Function targetSize

packages/effect/src/Pool.ts:1187–1193  ·  view source on GitHub ↗
(self: Pool<A, E>)

Source from the content-addressed store, hash-verified

1185 )
1186
1187const targetSize = <A, E>(self: Pool<A, E>) => {
1188 if (self.state.isShuttingDown) return 0
1189 if (self.config.isFixed) return self.config.minSize
1190 const utilization = self.state.usage / self.config.targetUtilization
1191 const target = Math.ceil(utilization / self.config.concurrency)
1192 return Math.min(Math.max(self.config.minSize, target), self.config.maxSize)
1193}
1194
1195const activeSize = <A, E>(self: Pool<A, E>) => {
1196 return self.state.items.size - self.state.invalidated.size

Callers 4

getFunction · 0.85
Pool.tsFile · 0.85
getSlowWithFunction · 0.85
resizeLoopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected