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

Function preCheck

packages/effect/src/RequestResolver.ts:1159–1187  ·  view source on GitHub ↗
(entry)

Source from the content-addressed store, hash-verified

1157 })
1158 },
1159 preCheck(entry) {
1160 const ocached = MutableHashMap.get(cache, entry.request)
1161 if (ocached._tag === "None") {
1162 const cached = { entry, exit: undefined as Request.Result<A> | undefined }
1163 MutableHashMap.set(cache, entry.request, cached)
1164 const prevComplete = entry.completeUnsafe
1165 entry.completeUnsafe = function(exit) {
1166 cached.exit = exit as any
1167 prevComplete(exit)
1168 }
1169 return true
1170 }
1171 const cached = ocached.value
1172 if (cached.exit) {
1173 if (strategy === "lru") {
1174 MutableHashMap.remove(cache, cached.entry.request)
1175 MutableHashMap.set(cache, cached.entry.request, cached)
1176 }
1177 entry.completeUnsafe(cached.exit as any)
1178 } else {
1179 cached.entry.uninterruptible = true
1180 const prevComplete = cached.entry.completeUnsafe
1181 cached.entry.completeUnsafe = function(exit) {
1182 prevComplete(exit)
1183 entry.completeUnsafe(exit)
1184 }
1185 }
1186 return false
1187 }
1188 })
1189 }))
1190

Callers

nothing calls this directly

Calls 4

completeUnsafeMethod · 0.80
getMethod · 0.65
setMethod · 0.65
removeMethod · 0.45

Tested by

no test coverage detected