<Key, A>(key: Key, value: A): <E, R>(
self: ScopedCache<Key, A, E, R>
) => Effect.Effect<void>
<Key, A, E, R>(
self: ScopedCache<Key, A, E, R>,
key: Key,
value: A
): Effect.Effect<void>Sets a successful value for a key without running the lookup function.
When to use
Use to seed or overwrite a scoped cache entry with an already available successful value.
Details
This replaces and closes any existing entry scope for the key, applies the cache's TTL using a successful exit for the value, and may evict older entries if the cache capacity is exceeded.
export const const set: {
<Key, A>(key: Key, value: A): <E, R>(
self: ScopedCache<Key, A, E, R>
) => Effect.Effect<void>
<Key, A, E, R>(
self: ScopedCache<Key, A, E, R>,
key: Key,
value: A
): Effect.Effect<void>
}
Sets a successful value for a key without running the lookup function.
When to use
Use to seed or overwrite a scoped cache entry with an already available
successful value.
Details
This replaces and closes any existing entry scope for the key, applies the
cache's TTL using a successful exit for the value, and may evict older
entries if the cache capacity is exceeded.
set: {
<function (type parameter) Key in <Key, A>(key: Key, value: A): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>Key, function (type parameter) A in <Key, A>(key: Key, value: A): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>A>(key: Keykey: function (type parameter) Key in <Key, A>(key: Key, value: A): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>Key, value: Avalue: function (type parameter) A in <Key, A>(key: Key, value: A): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>A): <function (type parameter) E in <E, R>(self: ScopedCache<Key, A, E, R>): Effect.Effect<void>E, function (type parameter) R in <E, R>(self: ScopedCache<Key, A, E, R>): Effect.Effect<void>R>(self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface ScopedCache<in out Key, in out A, in out E = never, out R = never>A scoped cache whose values are acquired by a lookup effect and stored in
per-entry scopes.
When to use
Use to cache values that acquire scoped resources and must release those
resources when entries expire, are evicted, or are invalidated.
Details
Concurrent requests for the same key share the same in-flight lookup.
Entries can expire based on the lookup exit, are evicted when capacity is
exceeded, and release their entry scopes when invalidated, evicted, expired,
or when the cache's owning scope closes.
ScopedCache<function (type parameter) Key in <Key, A>(key: Key, value: A): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>Key, function (type parameter) A in <Key, A>(key: Key, value: A): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<void>A, function (type parameter) E in <E, R>(self: ScopedCache<Key, A, E, R>): Effect.Effect<void>E, function (type parameter) R in <E, R>(self: ScopedCache<Key, A, E, R>): Effect.Effect<void>R>) => import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<void>
<function (type parameter) Key in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>Key, function (type parameter) A in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>A, function (type parameter) E in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>E, function (type parameter) R in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>R>(self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface ScopedCache<in out Key, in out A, in out E = never, out R = never>A scoped cache whose values are acquired by a lookup effect and stored in
per-entry scopes.
When to use
Use to cache values that acquire scoped resources and must release those
resources when entries expire, are evicted, or are invalidated.
Details
Concurrent requests for the same key share the same in-flight lookup.
Entries can expire based on the lookup exit, are evicted when capacity is
exceeded, and release their entry scopes when invalidated, evicted, expired,
or when the cache's owning scope closes.
ScopedCache<function (type parameter) Key in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>Key, function (type parameter) A in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>A, function (type parameter) E in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>E, function (type parameter) R in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>R>, key: Keykey: function (type parameter) Key in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>Key, value: Avalue: function (type parameter) A in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>A): import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<void>
} = import dualdual(
3,
<function (type parameter) Key in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>Key, function (type parameter) A in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>A, function (type parameter) E in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>E, function (type parameter) R in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>R>(self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface ScopedCache<in out Key, in out A, in out E = never, out R = never>A scoped cache whose values are acquired by a lookup effect and stored in
per-entry scopes.
When to use
Use to cache values that acquire scoped resources and must release those
resources when entries expire, are evicted, or are invalidated.
Details
Concurrent requests for the same key share the same in-flight lookup.
Entries can expire based on the lookup exit, are evicted when capacity is
exceeded, and release their entry scopes when invalidated, evicted, expired,
or when the cache's owning scope closes.
ScopedCache<function (type parameter) Key in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>Key, function (type parameter) A in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>A, function (type parameter) E in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>E, function (type parameter) R in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>R>, key: Keykey: function (type parameter) Key in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>Key, value: Avalue: function (type parameter) A in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>A): import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<void> =>
import effecteffect.const uninterruptible: <A, E, R>(
self: Effect.Effect<A, E, R>
) => Effect.Effect<A, E, R>
uninterruptible(
import corecore.const withFiber: <
A,
E = never,
R = never
>(
evaluate: (
fiber: FiberImpl<unknown, unknown>
) => Effect.Effect<A, E, R>
) => Effect.Effect<A, E, R>
withFiber((fiber: effect.FiberImpl<unknown, unknown>(parameter) fiber: {
id: number;
interruptible: boolean;
currentOpCount: number;
currentLoopCount: number;
_stack: Array<Primitive>;
_observers: Array<(exit: Exit.Exit<A, E>) => void>;
_exit: Exit.Exit<A, E> | undefined;
_currentExit: Exit.Exit<A, E> | undefined;
_children: Set<FiberImpl<any, any>> | undefined;
_interruptedCause: Cause.Cause<never> | undefined;
_yielded: Exit.Exit<any, any> | (() => void) | undefined;
context: Context.Context<never>;
currentScheduler: Scheduler.Scheduler;
currentTracerContext: Tracer.Tracer["context"];
currentSpan: Tracer.AnySpan | undefined;
currentLogLevel: LogLevel.LogLevel;
minimumLogLevel: LogLevel.LogLevel;
currentStackFrame: StackFrame | undefined;
runtimeMetrics: Metric.FiberRuntimeMetricsService | undefined;
maxOpsBeforeYield: number;
currentPreventYield: boolean;
_dispatcher: Scheduler.SchedulerDispatcher | undefined;
currentDispatcher: SchedulerDispatcher;
getRef: <X>(ref: Context.Reference<X>) => X;
addObserver: (cb: (exit: Exit.Exit<unknown, unknown>) => void) => () => void;
interruptUnsafe: (fiberId?: number | undefined, annotations?: Context.Context<never> | undefined) => void;
pollUnsafe: () => Exit.Exit<unknown, unknown> | undefined;
evaluate: (effect: core.Primitive) => void;
runLoop: (effect: core.Primitive) => typeof core.Yield | Exit.Exit<unknown, unknown>;
getCont: <S extends core.contA | core.contE>(symbol: S) => (core.Primitive & Record<S, (value: any, fiber: effect.FiberImpl) => core.Primitive>) | undefined;
yieldWith: (value: Exit.Exit<any, any> | (() => void)) => core.Yield;
children: () => Set<Fiber.Fiber<any, any>>;
pipe: () => unknown;
setContext: (context: Context.Context<never>) => void;
currentSpanLocal: Span | undefined;
}
fiber) => {
if (self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self.ScopedCache<Key, A, E, R>.state: State<Key, A, E>state._tag: "Open" | "Closed"_tag === "Closed") {
return import effecteffect.const interrupt: Effect.Effect<never>const interrupt: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
interrupt
}
const const oentry: Option.Option<Entry<A, E>>oentry = import MutableHashMapMutableHashMap.get(self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self.ScopedCache<Key, A, E, R>.state: State<Key, A, E>state.map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
(property) map: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
map, key: Keykey)
const const state: {
readonly _tag: "Open"
readonly map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
}
state = self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self.ScopedCache<Key, A, E, R>.state: State<Key, A, E>state
const const exit: Exit.Exit<A, never>exit = import corecore.const exitSucceed: <A>(
a: A
) => Exit.Exit<A>
exitSucceed(value: Avalue)
const const deferred: Deferred.Deferred<A, E>const deferred: {
effect: Effect<A, E>;
resumes: Array<(effect: Effect<A, E>) => void> | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
deferred = import DeferredDeferred.makeUnsafe<function (type parameter) A in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>A, function (type parameter) E in <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key, value: A): Effect.Effect<void>E>()
import DeferredDeferred.doneUnsafe(const deferred: Deferred.Deferred<A, E>const deferred: {
effect: Effect<A, E>;
resumes: Array<(effect: Effect<A, E>) => void> | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
deferred, const exit: Exit.Exit<A, never>exit)
const const ttl: Duration.Durationconst ttl: {
value: DurationValue;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
ttl = self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self.ScopedCache<Key, A, E, R>.timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.DurationtimeToLive(const exit: Exit.Exit<A, never>exit, key: Keykey)
import MutableHashMapMutableHashMap.set(const state: {
readonly _tag: "Open"
readonly map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
}
state.map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
(property) map: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
map, key: Keykey, {
scope: Scope.Closeable(property) scope: {
strategy: "sequential" | "parallel";
state: State.Open | State.Closed | State.Empty;
}
scope: import ScopeScope.makeUnsafe(),
deferred: Deferred.Deferred<A, E>(property) deferred: {
effect: Effect<A, E>;
resumes: Array<(effect: Effect<A, E>) => void> | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
deferred,
expiresAt: anyexpiresAt: import DurationDuration.isFinite(const ttl: Duration.Durationconst ttl: {
value: DurationValue;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
ttl)
? fiber: effect.FiberImpl<unknown, unknown>(parameter) fiber: {
id: number;
interruptible: boolean;
currentOpCount: number;
currentLoopCount: number;
_stack: Array<Primitive>;
_observers: Array<(exit: Exit.Exit<A, E>) => void>;
_exit: Exit.Exit<A, E> | undefined;
_currentExit: Exit.Exit<A, E> | undefined;
_children: Set<FiberImpl<any, any>> | undefined;
_interruptedCause: Cause.Cause<never> | undefined;
_yielded: Exit.Exit<any, any> | (() => void) | undefined;
context: Context.Context<never>;
currentScheduler: Scheduler.Scheduler;
currentTracerContext: Tracer.Tracer["context"];
currentSpan: Tracer.AnySpan | undefined;
currentLogLevel: LogLevel.LogLevel;
minimumLogLevel: LogLevel.LogLevel;
currentStackFrame: StackFrame | undefined;
runtimeMetrics: Metric.FiberRuntimeMetricsService | undefined;
maxOpsBeforeYield: number;
currentPreventYield: boolean;
_dispatcher: Scheduler.SchedulerDispatcher | undefined;
currentDispatcher: SchedulerDispatcher;
getRef: <X>(ref: Context.Reference<X>) => X;
addObserver: (cb: (exit: Exit.Exit<unknown, unknown>) => void) => () => void;
interruptUnsafe: (fiberId?: number | undefined, annotations?: Context.Context<never> | undefined) => void;
pollUnsafe: () => Exit.Exit<unknown, unknown> | undefined;
evaluate: (effect: core.Primitive) => void;
runLoop: (effect: core.Primitive) => typeof core.Yield | Exit.Exit<unknown, unknown>;
getCont: <S extends core.contA | core.contE>(symbol: S) => (core.Primitive & Record<S, (value: any, fiber: effect.FiberImpl) => core.Primitive>) | undefined;
yieldWith: (value: Exit.Exit<any, any> | (() => void)) => core.Yield;
children: () => Set<Fiber.Fiber<any, any>>;
pipe: () => unknown;
setContext: (context: Context.Context<never>) => void;
currentSpanLocal: Span | undefined;
}
fiber.FiberImpl<X>(ref: Context.Reference<X>): XgetRef(import effecteffect.const ClockRef: Context.Reference<Clock>const ClockRef: {
key: string;
Service: {
currentTimeMillisUnsafe: () => number;
currentTimeMillis: Effect<number>;
currentTimeNanosUnsafe: () => bigint;
currentTimeNanos: Effect<bigint>;
sleep: (duration: Duration.Duration) => Effect<void>;
};
defaultValue: () => Shape;
of: (this: void, self: Clock) => Clock;
context: (self: Clock) => Context.Context<never>;
use: (f: (service: Clock) => Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
useSync: (f: (service: Clock) => A) => Effect.Effect<A, never, never>;
Identifier: Identifier;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
ClockRef).currentTimeMillisUnsafe() + import DurationDuration.toMillis(const ttl: Duration.Durationconst ttl: {
value: DurationValue;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
ttl)
: var undefinedundefined
})
const const check: Effect.Effect<
void,
never,
never
>
const check: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
check = const checkCapacity: <K, A, E>(
parent: Fiber.Fiber<unknown, unknown>,
map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>,
capacity: number
) => Effect.Effect<void>
checkCapacity(fiber: effect.FiberImpl<unknown, unknown>(parameter) fiber: {
id: number;
interruptible: boolean;
currentOpCount: number;
currentLoopCount: number;
_stack: Array<Primitive>;
_observers: Array<(exit: Exit.Exit<A, E>) => void>;
_exit: Exit.Exit<A, E> | undefined;
_currentExit: Exit.Exit<A, E> | undefined;
_children: Set<FiberImpl<any, any>> | undefined;
_interruptedCause: Cause.Cause<never> | undefined;
_yielded: Exit.Exit<any, any> | (() => void) | undefined;
context: Context.Context<never>;
currentScheduler: Scheduler.Scheduler;
currentTracerContext: Tracer.Tracer["context"];
currentSpan: Tracer.AnySpan | undefined;
currentLogLevel: LogLevel.LogLevel;
minimumLogLevel: LogLevel.LogLevel;
currentStackFrame: StackFrame | undefined;
runtimeMetrics: Metric.FiberRuntimeMetricsService | undefined;
maxOpsBeforeYield: number;
currentPreventYield: boolean;
_dispatcher: Scheduler.SchedulerDispatcher | undefined;
currentDispatcher: SchedulerDispatcher;
getRef: <X>(ref: Context.Reference<X>) => X;
addObserver: (cb: (exit: Exit.Exit<unknown, unknown>) => void) => () => void;
interruptUnsafe: (fiberId?: number | undefined, annotations?: Context.Context<never> | undefined) => void;
pollUnsafe: () => Exit.Exit<unknown, unknown> | undefined;
evaluate: (effect: core.Primitive) => void;
runLoop: (effect: core.Primitive) => typeof core.Yield | Exit.Exit<unknown, unknown>;
getCont: <S extends core.contA | core.contE>(symbol: S) => (core.Primitive & Record<S, (value: any, fiber: effect.FiberImpl) => core.Primitive>) | undefined;
yieldWith: (value: Exit.Exit<any, any> | (() => void)) => core.Yield;
children: () => Set<Fiber.Fiber<any, any>>;
pipe: () => unknown;
setContext: (context: Context.Context<never>) => void;
currentSpanLocal: Span | undefined;
}
fiber, const state: {
readonly _tag: "Open"
readonly map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
}
state.map: MutableHashMap.MutableHashMap<
K,
Entry<A, E>
>
(property) map: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
map, self: ScopedCache<Key, A, E, R>(parameter) self: {
state: State<Key, A, E>;
capacity: number;
lookup: (key: Key) => Effect.Effect<A, E, R | Scope.Scope>;
timeToLive: (exit: Exit.Exit<A, E>, key: Key) => Duration.Duration;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self.ScopedCache<in out Key, in out A, in out E = never, out R = never>.capacity: numbercapacity)
return import OptionOption.isSome(const oentry: Option.Option<Entry<A, E>>oentry)
? import effecteffect.const flatMap: {
<A, B, E2, R2>(
f: (a: A) => Effect.Effect<B, E2, R2>
): <E, R>(
self: Effect.Effect<A, E, R>
) => Effect.Effect<B, E | E2, R | R2>
<A, E, R, B, E2, R2>(
self: Effect.Effect<A, E, R>,
f: (a: A) => Effect.Effect<B, E2, R2>
): Effect.Effect<B, E | E2, R | R2>
}
flatMap(import ScopeScope.close(const oentry: Option.Some<Entry<A, E>>const oentry: {
_tag: "Some";
_op: "Some";
value: A;
valueOrUndefined: A;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
oentry.value.scope, import effecteffect.const exitVoid: Exit.Exit<void>exitVoid), () => const check: Effect.Effect<
void,
never,
never
>
const check: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
check)
: const check: Effect.Effect<
void,
never,
never
>
const check: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
check
})
)
)