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

Function void_

packages/sql/src/SqlResolver.ts:417–463  ·  view source on GitHub ↗
(
  tag: T,
  options:
    | {
      readonly Request: Schema.Schema<I, II, RI>
      readonly execute: (
        requests: Array<Types.NoInfer<II>>
      ) => Effect.Effect<ReadonlyArray<unknown>, E>
      readonly withContext?: false
    }
    | {
      readonly Request: Schema.Schema<I, II, RI>
      readonly execute: (
        requests: Array<Types.NoInfer<II>>
      ) => Effect.Effect<unknown, E, R>
      readonly withContext: true
    }
)

Source from the content-addressed store, hash-verified

415 return makeResolver(resolver, tag, options.Id, options.withContext)
416}
417const void_ = <T extends string, I, II, RI, E, R = never>(
418 tag: T,
419 options:
420 | {
421 readonly Request: Schema.Schema<I, II, RI>
422 readonly execute: (
423 requests: Array<Types.NoInfer<II>>
424 ) => Effect.Effect<ReadonlyArray<unknown>, E>
425 readonly withContext?: false
426 }
427 | {
428 readonly Request: Schema.Schema<I, II, RI>
429 readonly execute: (
430 requests: Array<Types.NoInfer<II>>
431 ) => Effect.Effect<unknown, E, R>
432 readonly withContext: true
433 }
434): Effect.Effect<SqlResolver<T, I, void, E, RI>, never, R> => {
435 const resolver = RequestResolver.makeBatched(
436 (requests: NonEmptyArray<SqlRequest<T, void, E>>) => {
437 const [inputs, spanLinks] = partitionRequests(requests)
438 return options.execute(inputs as any).pipe(
439 Effect.andThen(
440 Effect.forEach(
441 requests,
442 (request) => Request.complete(request, Exit.void),
443 { discard: true }
444 )
445 ),
446 Effect.catchAllCause((cause) =>
447 Effect.forEach(
448 requests,
449 (request) => Request.failCause(request, cause),
450 { discard: true }
451 )
452 ),
453 Effect.withSpan(`sql.Resolver.batch ${tag}`, {
454 kind: "client",
455 links: spanLinks,
456 attributes: { "request.count": inputs.length },
457 captureStackTrace: false
458 })
459 ) as Effect.Effect<void>
460 }
461 ).identified(`@effect/sql/SqlResolver.void/${tag}`)
462 return makeResolver(resolver, tag, options.Request, options.withContext)
463}
464
465export {
466 /**

Callers

nothing calls this directly

Calls 7

partitionRequestsFunction · 0.85
makeResolverFunction · 0.85
completeMethod · 0.80
failCauseMethod · 0.80
identifiedMethod · 0.65
pipeMethod · 0.65
executeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…