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

Function makeGrouped

packages/effect/src/RequestResolver.ts:294–303  ·  view source on GitHub ↗
(options: {
  readonly key: (entry: Request.Entry<A>) => K
  readonly resolver: (entries: NonEmptyArray<Request.Entry<A>>, key: K) => Effect.Effect<void, Request.Error<A>>
})

Source from the content-addressed store, hash-verified

292 * @since 4.0.0
293 */
294export const makeGrouped = <A extends Request.Any, K>(options: {
295 readonly key: (entry: Request.Entry<A>) => K
296 readonly resolver: (entries: NonEmptyArray<Request.Entry<A>>, key: K) => Effect.Effect<void, Request.Error<A>>
297}): RequestResolver<A> =>
298 makeWith({
299 batchKey: hashGroupKey(options.key),
300 delay: Effect.yieldNow,
301 collectWhile: constTrue,
302 runAll: options.resolver as any
303 })
304
305const hashGroupKey = <A, K>(get: (entry: Request.Entry<A>) => K) => {
306 const groupKeys = MutableHashMap.empty<K, K>()

Callers

nothing calls this directly

Calls 2

hashGroupKeyFunction · 0.85
makeWithFunction · 0.70

Tested by

no test coverage detected