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

Function startShared

packages/effect/src/ui/Query.ts:6209–6229  ·  view source on GitHub ↗
(
    entry: Entry,
    build: Build,
    callers: Iterable<Waiter>,
    restart: boolean
  )

Source from the content-addressed store, hash-verified

6207 resumeAll(shared.callers, callerExit(exit))
6208 }
6209 const startShared = (
6210 entry: Entry,
6211 build: Build,
6212 callers: Iterable<Waiter>,
6213 restart: boolean
6214 ): Shared => {
6215 const shared: Shared = {
6216 entry,
6217 build,
6218 callers: new Set(),
6219 fiber: undefined
6220 }
6221 for (const caller of callers) {
6222 caller.shared = shared
6223 shared.callers.add(caller)
6224 }
6225 entry.shared = shared
6226 sharedFetches.add(shared)
6227 runShared(shared, restart)
6228 return shared
6229 }
6230 /** A caller leaves: the fetch lives while it has callers. */
6231 const leave = (entry: Entry, waiter: Waiter): void => {
6232 const shared = waiter.shared

Callers 2

getSharedFunction · 0.85
beginRunFunction · 0.85

Calls 2

runSharedFunction · 0.85
addMethod · 0.65

Tested by

no test coverage detected