import * as L from "@effect-ts/core/Collections/Immutable/List"; import * as T from "@effect-ts/core/Effect"; import { _R } from "@effect-ts/core/Effect"; import * as S from "@effect-ts/core/Sync"; import type { Cache } from "../../Cache/index.js"; import * as DS from "../../DataSource/index.js"; import type { DataSourceAspect } from "../../DataSourceAspect/index.js"; import type { BlockedRequest } from "../BlockedRequest/index.js"; import * as PL from "../Parallel/index.js"; import * as SQ from "../Sequential/index.js"; declare class Both { readonly left: BlockedRequests; readonly right: BlockedRequests; readonly _tag = "Both"; readonly [_R]: (r: R) => void; constructor(left: BlockedRequests, right: BlockedRequests); } declare class Empty { readonly _tag = "Empty"; readonly [_R]: (r: R) => void; } declare class Single { readonly dataSource: DS.DataSource; readonly blockedRequest: BlockedRequest; readonly _tag = "Single"; readonly [_R]: (r: R) => void; constructor(dataSource: DS.DataSource, blockedRequest: BlockedRequest); } declare class Then { readonly left: BlockedRequests; readonly right: BlockedRequests; readonly _tag = "Then"; readonly [_R]: (r: R) => void; constructor(left: BlockedRequests, right: BlockedRequests); } /** * `BlockedRequests` 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. */ export declare type BlockedRequests = Both | Empty | Single | Then; /** * Combines this collection of blocked requests with the specified collection * of blocked requests, in parallel. */ export declare function both(that: BlockedRequests): (self: BlockedRequests) => BlockedRequests; export declare function both_(self: BlockedRequests, that: BlockedRequests): Both; /** * Combines this collection of blocked requests with the specified collection * of blocked requests, in sequence. */ export declare function then(that: BlockedRequests): (self: BlockedRequests) => BlockedRequests; export declare function then_(self: BlockedRequests, that: BlockedRequests): Then; /** * Transforms all data sources with the specified data source aspect, which * can change the environment type of data sources but must preserve the * request type of each data source. */ export declare function mapDataSources(f: DataSourceAspect): (fa: BlockedRequests) => BlockedRequests; /** * Transforms all data sources with the specified data source aspect, which * can change the environment type of data sources but must preserve the * request type of each data source. */ export declare function mapDataSources_(fa: BlockedRequests, f: DataSourceAspect): BlockedRequests; /** * Provides each data source with part of its required environment. */ export declare function provideSome(description: string, f: (a: R0) => R): (fa: BlockedRequests) => BlockedRequests; /** * Provides each data source with part of its required environment. */ export declare function provideSomeSafe(description: string, f: (a: R0) => R): (fa: BlockedRequests) => S.UIO>; /** * The empty collection of blocked requests. */ export declare const empty: BlockedRequests; /** * Constructs a collection of blocked requests from the specified blocked * request and data source. */ export declare function single(dataSource: DS.DataSource, blockedRequest: BlockedRequest): BlockedRequests; /** * Merges a collection of requests that must be executed sequentially with a * collection of requests that can be executed in parallel. If the * collections are both from the same single data source then the requests * can be pipelined while preserving ordering guarantees. */ export declare function merge(sequential: L.List>, parallel: PL.Parallel): L.List>; /** * Flattens a collection of blocked requests into a collection of pipelined * and batched requests that can be submitted for execution. */ export declare function flatten(blockedRequests: BlockedRequests): L.List>; /** * Takes one step in evaluating a collection of blocked requests, returning a * collection of blocked requests that can be performed in parallel and a * list of blocked requests that must be performed sequentially after those * requests. */ export declare function step(c: BlockedRequests): readonly [PL.Parallel, L.List>]; /** * Executes all requests, submitting requests to each data source in * parallel. */ export declare function run(cache: Cache): (self: BlockedRequests) => T.Effect; export {}; //# sourceMappingURL=index.d.ts.map