MCPcopy Create free account
hub / github.com/effect-app/libs / fromFunctionBatched

Function fromFunctionBatched

repos/effect/packages/effect/src/RequestResolver.ts:377–389  ·  view source on GitHub ↗
(
  f: (entries: NonEmptyArray<Request.Entry<A>>) => Iterable<Request.Success<A>>
)

Source from the content-addressed store, hash-verified

375 * const GetDoubleRequest = Request.tagged<GetDoubleRequest>("GetDoubleRequest")
376 *
377 * // Create a resolver that processes multiple requests in a batch
378 * const DoubleResolver = RequestResolver.fromFunctionBatched<GetDoubleRequest>(
379 * (entries) => entries.map((entry) => entry.request.value * 2)
380 * )
381 *
382 * // Usage with multiple requests
383 * const effects = [1, 2, 3].map((value) =>
384 * Effect.request(GetDoubleRequest({ value }), DoubleResolver)
385 * )
386 * const batchedEffect = Effect.all(effects)
387 * await Effect.runPromise(batchedEffect) // => [2, 4, 6]
388 * ```
389 *
390 * @category constructors
391 * @since 2.0.0
392 */

Callers

nothing calls this directly

Calls 4

syncMethod · 0.80
completeUnsafeMethod · 0.80
makeFunction · 0.70
fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…