State<A, E>Mutable runtime state maintained by a Pool.
When to use
Use when you need to inspect or support the runtime state backing a Pool,
including its scope, item sets, semaphores, waiters, invalidation tracking,
and shutdown flag.
Details
This state tracks the pool scope, active and available items, invalidated items, semaphores, waiters, and shutdown status. It is exposed for inspection and implementation support; user code should prefer the high-level pool operations.
export interface interface State<A, E>Mutable runtime state maintained by a Pool.
When to use
Use when you need to inspect or support the runtime state backing a Pool,
including its scope, item sets, semaphores, waiters, invalidation tracking,
and shutdown flag.
Details
This state tracks the pool scope, active and available items, invalidated
items, semaphores, waiters, and shutdown status. It is exposed for
inspection and implementation support; user code should prefer the
high-level pool operations.
State<function (type parameter) A in State<A, E>A, function (type parameter) E in State<A, E>E> {
readonly State<A, E>.scope: Scope.Scope(property) State<A, E>.scope: {
strategy: "sequential" | "parallel";
state: State.Open | State.Closed | State.Empty;
}
scope: import ScopeScope.Scope
State<A, E>.isShuttingDown: booleanisShuttingDown: boolean
readonly State<A, E>.semaphore: Semaphore.Semaphore(property) State<A, E>.semaphore: {
resize: (this: Semaphore, permits: number) => Effect.Effect<void>;
withPermits: (this: Semaphore, permits: number) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
withPermit: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
withPermitsIfAvailable: (this: Semaphore, permits: number) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<Option.Option<A>, E, R>;
take: (this: Semaphore, permits: number) => Effect.Effect<number>;
release: (this: Semaphore, permits: number) => Effect.Effect<number>;
releaseAll: Effect.Effect<number>;
}
semaphore: import SemaphoreSemaphore.Semaphore
readonly State<A, E>.resizeSemaphore: Semaphore.Semaphore(property) State<A, E>.resizeSemaphore: {
resize: (this: Semaphore, permits: number) => Effect.Effect<void>;
withPermits: (this: Semaphore, permits: number) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
withPermit: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
withPermitsIfAvailable: (this: Semaphore, permits: number) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<Option.Option<A>, E, R>;
take: (this: Semaphore, permits: number) => Effect.Effect<number>;
release: (this: Semaphore, permits: number) => Effect.Effect<number>;
releaseAll: Effect.Effect<number>;
}
resizeSemaphore: import SemaphoreSemaphore.Semaphore
readonly State<A, E>.items: Set<PoolItem<A, E>>items: interface Set<T>Set<interface PoolItem<A, E>Internal record for a value managed by a Pool.
When to use
Use when implementing a custom pool Strategy that needs to inspect
acquired items, track reference counts, or return reclaimable items to the
pool.
Details
Each item stores the acquisition Exit, its finalizer, the current
reference count, and whether automatic reclaiming has been disabled because
the item was invalidated.
PoolItem<function (type parameter) A in State<A, E>A, function (type parameter) E in State<A, E>E>>
readonly State<A, E>.available: Set<PoolItem<A, E>>available: interface Set<T>Set<interface PoolItem<A, E>Internal record for a value managed by a Pool.
When to use
Use when implementing a custom pool Strategy that needs to inspect
acquired items, track reference counts, or return reclaimable items to the
pool.
Details
Each item stores the acquisition Exit, its finalizer, the current
reference count, and whether automatic reclaiming has been disabled because
the item was invalidated.
PoolItem<function (type parameter) A in State<A, E>A, function (type parameter) E in State<A, E>E>>
readonly State<A, E>.availableLatch: Latch.Latch(property) State<A, E>.availableLatch: {
open: Effect.Effect<boolean>;
openUnsafe: (this: Latch) => boolean;
release: Effect.Effect<boolean>;
await: Effect.Effect<void>;
close: Effect.Effect<boolean>;
closeUnsafe: (this: Latch) => boolean;
whenOpen: <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
isOpen: (this: Latch) => boolean;
}
availableLatch: import LatchLatch.type Latch.Latch = /*unresolved*/ anyLatch
readonly State<A, E>.invalidated: Set<PoolItem<A, E>>invalidated: interface Set<T>Set<interface PoolItem<A, E>Internal record for a value managed by a Pool.
When to use
Use when implementing a custom pool Strategy that needs to inspect
acquired items, track reference counts, or return reclaimable items to the
pool.
Details
Each item stores the acquisition Exit, its finalizer, the current
reference count, and whether automatic reclaiming has been disabled because
the item was invalidated.
PoolItem<function (type parameter) A in State<A, E>A, function (type parameter) E in State<A, E>E>>
State<A, E>.waiters: numberwaiters: number
}