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

Function getStored

packages/effect/src/ui/Query.ts:6459–6469  ·  view source on GitHub ↗
(entry: Entry, build: Build)

Source from the content-addressed store, hash-verified

6457
6458 /** Waits for the stored fetch, starting one when none is in flight. */
6459 const getStored = (entry: Entry, build: Build): Effect.Effect<any, any> =>
6460 Effect.callback<any, any>((resume) => {
6461 const waiter: Waiter = { build, resume, shared: undefined }
6462 entry.waiters.add(waiter)
6463 cancelIdle(entry)
6464 // During a list's append, the walk it waits for is owed.
6465 if (entry.fetch?.append) entry.owed ??= "get"
6466 // A reconnecting stream's next element answers it.
6467 if (entry.live === undefined) ensureFetch(entry, "get", build)
6468 return Effect.sync(() => leave(entry, waiter))
6469 })
6470
6471 // The order of checks: own target, hydration window, live patch, staleness.
6472 const get: CacheInternals["get"] = (def, args, fetcher, run, parent) =>

Callers 1

getFunction · 0.85

Calls 5

cancelIdleFunction · 0.85
ensureFetchFunction · 0.85
leaveFunction · 0.70
addMethod · 0.65
syncMethod · 0.45

Tested by

no test coverage detected