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

Function removeAvailable

packages/effect/src/Pool.ts:880–895  ·  view source on GitHub ↗
(self: Pool<A, E>, item: PoolItem<A, E>)

Source from the content-addressed store, hash-verified

878}
879
880const removeAvailable = <A, E>(self: Pool<A, E>, item: PoolItem<A, E>): void => {
881 if (!item.isAvailable) return
882 item.isAvailable = false
883 if (item.availablePrevious !== undefined) {
884 item.availablePrevious.availableNext = item.availableNext
885 } else {
886 self.state.availableHead = item.availableNext
887 }
888 if (item.availableNext !== undefined) {
889 item.availableNext.availablePrevious = item.availablePrevious
890 } else {
891 self.state.availableTail = item.availablePrevious
892 }
893 item.availablePrevious = undefined
894 item.availableNext = undefined
895}
896
897/**
898 * Invalidates the specified item so the pool can remove it and reallocate the

Callers 4

Pool.tsFile · 0.85
leaseItemBookkeepingFunction · 0.85
removeFailedItemFunction · 0.85
invalidatePoolItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected