effect-io-ai

Package: effect
Module: ScopedCache

ScopedCache.get

Gets the value for a key, running the cache lookup when no unexpired entry is present.

When to use

Use to retrieve a scoped cached value by key when a missing or expired entry should run the cache lookup and share the in-flight lookup with concurrent callers.

Details

Concurrent get calls for the same key share the same in-flight lookup. Successful and failed lookup exits are cached according to the configured TTL. If the cache is closed, the effect is interrupted.

See

Signature

declare const get: { <Key, A>(key: Key): <E, R>(self: ScopedCache<Key, A, E, R>) => Effect.Effect<A, E, R>; <Key, A, E, R>(self: ScopedCache<Key, A, E, R>, key: Key): Effect.Effect<A, E, R>; }

Source

Since v4.0.0