RequestBlock
Constructors
Signature
declare const empty: RequestBlock;mapRequestResolvers
Added in v2.0.0
Source
Signature
declare const mapRequestResolvers: <A>(
self: RequestBlock,
f: (dataSource: RequestResolver.RequestResolver<A>) => RequestResolver.RequestResolver<A>,
) => RequestBlock;Signature
declare const parallel: (self: RequestBlock, that: RequestBlock) => RequestBlock;Signature
declare const reduce: <Z>(self: RequestBlock, reducer: RequestBlock.Reducer<Z>) => Z;sequential
Added in v2.0.0
Source
Signature
declare const sequential: (self: RequestBlock, that: RequestBlock) => RequestBlock;Signature
declare const single: <A>(
dataSource: RequestResolver.RequestResolver<A>,
blockedRequest: Request.Entry<A>,
) => RequestBlock;Models
Signature
interface Empty {
readonly _tag: "Empty";
}Signature
interface Par {
readonly _tag: "Par";
readonly left: RequestBlock;
readonly right: RequestBlock;
}RequestBlock
Added in v2.0.0
Source
RequestBlock type
Added in v2.0.0
Source
Signature
type RequestBlock = Empty | Par | Seq | Single;Signature
interface Seq {
readonly _tag: "Seq";
readonly left: RequestBlock;
readonly right: RequestBlock;
}Signature
interface Single {
readonly _tag: "Single";
readonly blockedRequest: Entry<unknown>;
readonly dataSource: RequestResolver<unknown>;
}
RequestBlockcaptures 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.