MCPcopy Index your code
hub / github.com/Effect-TS/effect / runBlockedRequests

Function runBlockedRequests

packages/effect/src/internal/fiberRuntime.ts:254–282  ·  view source on GitHub ↗
(self: RequestBlock.RequestBlock)

Source from the content-addressed store, hash-verified

252 * Executes all requests, submitting requests to each data source in parallel.
253 */
254const runBlockedRequests = (self: RequestBlock.RequestBlock) =>
255 core.forEachSequentialDiscard(
256 RequestBlock_.flatten(self),
257 (requestsByRequestResolver) =>
258 forEachConcurrentDiscard(
259 RequestBlock_.sequentialCollectionToChunk(requestsByRequestResolver),
260 ([dataSource, sequential]) => {
261 const map = new Map<Request<any, any>, Entry<any>>()
262 const arr: Array<Array<Entry<any>>> = []
263 for (const block of sequential) {
264 arr.push(Chunk.toReadonlyArray(block) as any)
265 for (const entry of block) {
266 map.set(entry.request as Request<any, any>, entry)
267 }
268 }
269 const flat = arr.flat()
270 return core.fiberRefLocally(
271 invokeWithInterrupt(dataSource.runAll(arr), flat, () =>
272 flat.forEach((entry) => {
273 entry.listeners.interrupted = true
274 })),
275 currentRequestMap,
276 map
277 )
278 },
279 false,
280 false
281 )
282 )
283
284/** @internal */
285export interface Snapshot {

Callers 1

["RunBlocked"]Method · 0.85

Calls 4

forEachConcurrentDiscardFunction · 0.85
invokeWithInterruptFunction · 0.85
runAllMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected