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

Function storeWrite

packages/effect/src/ui/Query.ts:6740–6754  ·  view source on GitHub ↗
(
    entry: Entry,
    value: unknown,
    fresh: boolean,
    parent?: queryCore.SpanContext | undefined
  )

Source from the content-addressed store, hash-verified

6738 }
6739 }
6740 const storeWrite = (
6741 entry: Entry,
6742 value: unknown,
6743 fresh: boolean,
6744 parent?: queryCore.SpanContext | undefined
6745 ): void => {
6746 const fetch = entry.fetch
6747 store(entry, AsyncResult.success(value, { timestamp: now() }))
6748 if (!fresh) entry.invalidated = true
6749 // A fetch that began before the write would overwrite it with older data.
6750 if (fetch !== undefined) replaceFetch(entry, fetch, parent)
6751 if (entry.idle !== undefined) startIdle(entry)
6752 emit(entry)
6753 afterQuiet(entry)
6754 }
6755 /** Returns the entries stored fresh, and adds those whose write was skipped to `skipped`. */
6756 const applyWrites = (
6757 run: Run,

Callers 1

applyWritesFunction · 0.85

Calls 6

replaceFetchFunction · 0.85
startIdleFunction · 0.85
afterQuietFunction · 0.85
storeFunction · 0.70
nowFunction · 0.70
emitFunction · 0.70

Tested by

no test coverage detected