/** * @since 1.0.0 */ import type * as Context from "@effect/data/Context"; import type { FiberRef } from "@effect/io/FiberRef"; import type * as Request from "@effect/io/Request"; import type * as RequestResolver from "@effect/io/RequestResolver"; /** * `RequestBlock` captures a collection of blocked requests as a data * structure. By doing this the library is able to preserve information about * which requests must be performed sequentially and which can be performed in * parallel, allowing for maximum possible batching and pipelining while * preserving ordering guarantees. * * @since 1.0.0 * @category models */ export type RequestBlock = Empty | Par | Seq | Single; /** * @since 1.0.0 * @category models */ export declare namespace RequestBlock { /** * @since 1.0.0 * @category models */ interface Reducer { readonly emptyCase: () => Z; readonly parCase: (left: Z, right: Z) => Z; readonly singleCase: (dataSource: RequestResolver.RequestResolver, blockedRequest: Request.Entry) => Z; readonly seqCase: (left: Z, right: Z) => Z; } } /** * @since 1.0.0 * @category models */ export interface Empty { readonly _tag: "Empty"; } /** * @since 1.0.0 * @category models */ export interface Par { readonly _tag: "Par"; readonly left: RequestBlock; readonly right: RequestBlock; } /** * @since 1.0.0 * @category models */ export interface Seq { readonly _tag: "Seq"; readonly left: RequestBlock; readonly right: RequestBlock; } /** * @since 1.0.0 * @category models */ export interface Single { readonly _tag: "Single"; readonly dataSource: RequestResolver.RequestResolver; readonly blockedRequest: Request.Entry; } /** * @since 1.0.0 * @category constructors */ export declare const single: (dataSource: RequestResolver.RequestResolver, blockedRequest: Request.Entry) => RequestBlock; /** * @since 1.0.0 * @category constructors */ export declare const empty: RequestBlock; /** * @since 1.0.0 * @category constructors */ export declare const mapRequestResolvers: (self: RequestBlock, f: (dataSource: RequestResolver.RequestResolver) => RequestResolver.RequestResolver) => RequestBlock; /** * @since 1.0.0 * @category constructors */ export declare const parallel: (self: RequestBlock, that: RequestBlock) => RequestBlock; /** * @since 1.0.0 * @category constructors */ export declare const reduce: (self: RequestBlock, reducer: RequestBlock.Reducer) => Z; /** * @since 1.0.0 * @category constructors */ export declare const sequential: (self: RequestBlock, that: RequestBlock) => RequestBlock; /** * Provides each data source with part of its required environment. * * @since 1.0.0 * @category utils */ export declare const mapInputContext: (self: RequestBlock, f: (context: Context.Context) => Context.Context) => RequestBlock; /** * Provides each data source with a fiber ref value. * * @since 1.0.0 * @category utils */ export declare const locally: (self: RequestBlock, ref: FiberRef, value: A) => RequestBlock; //# sourceMappingURL=RequestBlock.d.ts.map