Documentation
¶
Overview ¶
Package batchweaver defines the public, typed contracts used to declare and implement semantically safe Go batch operations.
The package provides generic request and response types, per-item outcomes, scalar and batch function signatures, and declarations that connect an operation.Spec to concrete implementations. Declarations have no global registration side effects and can be discovered statically by the BatchWeaver analyzer.
A batch provider must return exactly one outcome for every request ID unless it returns a global error. Helpers such as OrderedOutcomes, KeyedOutcomes, and SparseOutcomes preserve request identity and validate result shape. See the package examples for a complete typed declaration.
Request coalescing is implemented by the runtime package, normally imported with an alias:
import batchruntime "github.com/Voskan/BatchWeaver/runtime"
Static analysis, proof-gated transformation, overlays, and materialization are exposed through the batchweaver command. Source is never changed merely by importing this package or declaring an operation.
Index ¶
- Constants
- Variables
- type BatchFunc
- type BatchItem
- type BatchMethod
- type BatchRequest
- type BatchResponse
- func KeyedOutcomes[K comparable, V any](req BatchRequest[K], values map[K]V, ...) (BatchResponse[V], error)
- func MustNewBatchResponse[V any](outcomes []Outcome[V]) BatchResponse[V]
- func NewBatchResponse[V any](outcomes []Outcome[V]) (BatchResponse[V], error)
- func OrderedOutcomes[K, V any](req BatchRequest[K], values []V) (BatchResponse[V], error)
- func OrderedResultOutcomes[K, V any](req BatchRequest[K], results []ItemResult[V]) (BatchResponse[V], error)
- func SparseOutcomes[K, V any](req BatchRequest[K], lookup func(key K) (V, bool), ...) (BatchResponse[V], error)
- type FunctionDeclaration
- type ItemResult
- type MethodDeclaration
- type Outcome
- type RequestID
- type ScalarFunc
- type ScalarMethod
Examples ¶
Constants ¶
const ( // MinPriority is the lowest allowed item priority. MinPriority = -1000 // MaxPriority is the highest allowed item priority. MaxPriority = 1000 )
Priority bounds. Priority is relative: higher values indicate higher priority.
Variables ¶
var ErrInvalidBatchItem = errors.New("invalid batch item")
ErrInvalidBatchItem is returned when a BatchItem fails validation.
var ErrInvalidBatchRequest = errors.New("invalid batch request")
ErrInvalidBatchRequest is returned when a BatchRequest fails validation.
var ErrInvalidBatchResponse = errors.New("invalid batch response")
ErrInvalidBatchResponse is returned when a BatchResponse fails validation.
var ErrInvalidOutcome = errors.New("invalid outcome")
ErrInvalidOutcome is returned when an Outcome fails validation.
var ErrNilImplementation = errors.New("nil implementation")
ErrNilImplementation is returned when a declaration is missing its scalar or batch implementation.
Functions ¶
This section is empty.
Types ¶
type BatchFunc ¶
type BatchFunc[K, V any] func(context.Context, BatchRequest[K]) (BatchResponse[V], error)
BatchFunc is the signature of a batch operation: many inputs, many outcomes. The returned error represents a global provider or transport failure; per-item failures belong in Outcome.Err.
type BatchItem ¶
type BatchItem[K any] struct { // ID identifies the request; it must be non-zero. ID RequestID // Key is the operation input for this request. Key K // Deadline is an optional per-item deadline; the zero time means none. Deadline time.Time // Priority is the relative priority within [MinPriority, MaxPriority]. Priority int // Weight is the item's cost contribution; it must be positive. Weight int }
BatchItem is one logical request within a batch. Key is the operation's input value; the remaining fields are batching metadata. A zero Deadline means the item has no item-specific deadline. K is unconstrained: keys need not be comparable.
func NewBatchItem ¶
NewBatchItem returns a BatchItem with the given ID and key, a weight of one, and no deadline or priority. Use the With* methods to set optional fields.
func (BatchItem[K]) WithDeadline ¶
WithDeadline returns a copy of the item with the given deadline.
func (BatchItem[K]) WithPriority ¶
WithPriority returns a copy of the item with the given priority.
func (BatchItem[K]) WithWeight ¶
WithWeight returns a copy of the item with the given weight.
type BatchMethod ¶
type BatchMethod[R, K, V any] func(R, context.Context, BatchRequest[K]) (BatchResponse[V], error)
BatchMethod is a batch operation expressed as a method expression.
type BatchRequest ¶
type BatchRequest[K any] struct { // contains filtered or unexported fields }
BatchRequest is an immutable-by-convention, ordered collection of batch items with unique request IDs. Construct it with NewBatchRequest, which defensively copies the input; accessors also return copies so callers cannot mutate the stored items.
func MustNewBatchRequest ¶
func MustNewBatchRequest[K any](items []BatchItem[K]) BatchRequest[K]
MustNewBatchRequest is like NewBatchRequest but panics on error. It is intended for tests and internal construction with known-valid input.
func NewBatchRequest ¶
func NewBatchRequest[K any](items []BatchItem[K]) (BatchRequest[K], error)
NewBatchRequest validates items and returns a BatchRequest. It rejects an empty request, invalid items, and duplicate request IDs, and copies the input slice so later mutation of the caller's slice does not affect the request.
func (BatchRequest[K]) IDs ¶
func (r BatchRequest[K]) IDs() []RequestID
IDs returns the request IDs in order.
func (BatchRequest[K]) Items ¶
func (r BatchRequest[K]) Items() []BatchItem[K]
Items returns a copy of the items in their original order.
func (BatchRequest[K]) Validate ¶
func (r BatchRequest[K]) Validate() error
Validate reports whether the request is well-formed. A request built by NewBatchRequest is always valid; this re-checks a value that may have been constructed as a zero value.
type BatchResponse ¶
type BatchResponse[V any] struct { // contains filtered or unexported fields }
BatchResponse is an immutable-by-convention, ordered collection of outcomes. Construct it with NewBatchResponse, which defensively copies the input; accessors return copies. Order is preserved but the type does not force any particular mapping policy.
func KeyedOutcomes ¶
func KeyedOutcomes[K comparable, V any]( req BatchRequest[K], values map[K]V, onMissing func(id RequestID, key K) Outcome[V], ) (BatchResponse[V], error)
KeyedOutcomes maps a map of values keyed by K to outcomes, one per request item. When a key is absent, onMissing is consulted; if onMissing is nil, a not-found outcome is produced. Duplicate keys across items yield separate outcomes with their own request IDs.
func MustNewBatchResponse ¶
func MustNewBatchResponse[V any](outcomes []Outcome[V]) BatchResponse[V]
MustNewBatchResponse is like NewBatchResponse but panics on error.
func NewBatchResponse ¶
func NewBatchResponse[V any](outcomes []Outcome[V]) (BatchResponse[V], error)
NewBatchResponse validates outcomes and returns a BatchResponse, copying the input slice. It rejects invalid outcomes but permits an empty response so that callers can represent a global failure with no outcomes.
func OrderedOutcomes ¶
func OrderedOutcomes[K, V any](req BatchRequest[K], values []V) (BatchResponse[V], error)
OrderedOutcomes maps a slice of values to outcomes by request order. It requires len(values) == req.Len() and treats every value as a success. Distinct request IDs are preserved even when item keys are equal.
func OrderedResultOutcomes ¶
func OrderedResultOutcomes[K, V any](req BatchRequest[K], results []ItemResult[V]) (BatchResponse[V], error)
OrderedResultOutcomes maps ordered per-item results to outcomes by request order. It requires len(results) == req.Len().
func SparseOutcomes ¶
func SparseOutcomes[K, V any]( req BatchRequest[K], lookup func(key K) (V, bool), onMissing func(id RequestID, key K) Outcome[V], ) (BatchResponse[V], error)
SparseOutcomes maps outcomes using a callback lookup, which avoids requiring comparable keys. When lookup reports a key absent, onMissing is consulted; if onMissing is nil, a not-found outcome is produced.
func (BatchResponse[V]) Len ¶
func (r BatchResponse[V]) Len() int
Len returns the number of outcomes.
func (BatchResponse[V]) Outcomes ¶
func (r BatchResponse[V]) Outcomes() []Outcome[V]
Outcomes returns a copy of the outcomes in order.
func (BatchResponse[V]) Validate ¶
func (r BatchResponse[V]) Validate() error
Validate reports whether all outcomes are well-formed and no request ID is duplicated.
func (BatchResponse[V]) ValidateAgainst ¶
func (r BatchResponse[V]) ValidateAgainst(requestIDs []RequestID) error
ValidateAgainst checks the response against the exact set of request IDs it should answer. It reports missing IDs, unexpected IDs, duplicate IDs, and invalid outcomes. The requestIDs argument is treated as the authoritative set.
type FunctionDeclaration ¶
type FunctionDeclaration[K, V any] struct { // contains filtered or unexported fields }
FunctionDeclaration connects an operation spec to concrete scalar and batch function implementations. It is an immutable-by-convention value with no global side effects: constructing one registers nothing.
func DeclareFunction ¶
func DeclareFunction[K, V any]( spec operation.Spec, scalar ScalarFunc[K, V], batch BatchFunc[K, V], ) (FunctionDeclaration[K, V], error)
DeclareFunction validates the spec and implementations and returns a FunctionDeclaration. It returns an error if the spec is invalid or either implementation is nil.
func MustDeclareFunction ¶
func MustDeclareFunction[K, V any]( spec operation.Spec, scalar ScalarFunc[K, V], batch BatchFunc[K, V], ) FunctionDeclaration[K, V]
MustDeclareFunction is like DeclareFunction but panics on error. It is meant for package-level declarations, where a failure is a programmer error. The panic message includes the operation ID and is deterministic.
Example ¶
package main
import (
"context"
"fmt"
batchweaver "github.com/Voskan/BatchWeaver"
"github.com/Voskan/BatchWeaver/operation"
)
type exampleUser struct {
ID int
Name string
}
func exampleLoadUser(_ context.Context, id int) (exampleUser, error) {
return exampleUser{ID: id, Name: "Ada"}, nil
}
func exampleLoadUsers(
_ context.Context,
req batchweaver.BatchRequest[int],
) (batchweaver.BatchResponse[exampleUser], error) {
values := make([]exampleUser, req.Len())
for i, item := range req.Items() {
values[i] = exampleUser{ID: item.Key, Name: "Ada"}
}
return batchweaver.OrderedOutcomes(req, values)
}
func main() {
getUser := batchweaver.MustDeclareFunction(
operation.MustNewSpec(
operation.MustParseID("users.get"),
operation.ReadOnly(),
operation.WithOrderedResults(),
operation.WithRequestScope(),
),
exampleLoadUser,
exampleLoadUsers,
)
fmt.Println(getUser.Spec().ID())
}
Output: users.get
func (FunctionDeclaration[K, V]) Batch ¶
func (d FunctionDeclaration[K, V]) Batch() BatchFunc[K, V]
Batch returns the batch implementation.
func (FunctionDeclaration[K, V]) Scalar ¶
func (d FunctionDeclaration[K, V]) Scalar() ScalarFunc[K, V]
Scalar returns the scalar implementation.
func (FunctionDeclaration[K, V]) Spec ¶
func (d FunctionDeclaration[K, V]) Spec() operation.Spec
Spec returns the operation spec.
func (FunctionDeclaration[K, V]) Validate ¶
func (d FunctionDeclaration[K, V]) Validate() error
Validate reports whether the declaration is well-formed.
type ItemResult ¶
type ItemResult[V any] struct { // Value is the successful value; meaningful only when Found is true. Value V // Err is a per-item error, if any. Err error // Found reports whether a value was produced. Found bool }
ItemResult is a per-item provider result used when adapting ordered results that may individually succeed, fail, or be missing.
type MethodDeclaration ¶
type MethodDeclaration[R, K, V any] struct { // contains filtered or unexported fields }
MethodDeclaration connects an operation spec to scalar and batch method expressions whose first parameter is the receiver R. It is immutable by convention and performs no global registration.
func DeclareMethod ¶
func DeclareMethod[R, K, V any]( spec operation.Spec, scalar ScalarMethod[R, K, V], batch BatchMethod[R, K, V], ) (MethodDeclaration[R, K, V], error)
DeclareMethod validates the spec and method expressions and returns a MethodDeclaration.
func MustDeclareMethod ¶
func MustDeclareMethod[R, K, V any]( spec operation.Spec, scalar ScalarMethod[R, K, V], batch BatchMethod[R, K, V], ) MethodDeclaration[R, K, V]
MustDeclareMethod is like DeclareMethod but panics on error, for package-level declarations.
func (MethodDeclaration[R, K, V]) Batch ¶
func (d MethodDeclaration[R, K, V]) Batch() BatchMethod[R, K, V]
Batch returns the batch method expression.
func (MethodDeclaration[R, K, V]) Scalar ¶
func (d MethodDeclaration[R, K, V]) Scalar() ScalarMethod[R, K, V]
Scalar returns the scalar method expression.
func (MethodDeclaration[R, K, V]) Spec ¶
func (d MethodDeclaration[R, K, V]) Spec() operation.Spec
Spec returns the operation spec.
func (MethodDeclaration[R, K, V]) Validate ¶
func (d MethodDeclaration[R, K, V]) Validate() error
Validate reports whether the declaration is well-formed.
type Outcome ¶
type Outcome[V any] struct { // RequestID identifies which request this outcome answers; non-zero. RequestID RequestID // Value is the successful result; meaningful only when Found is true. Value V // Err is the per-item error; non-nil only for a failure outcome. Err error // Found reports whether a value was produced. Found bool }
Outcome is the result of a single logical request within a batch. Exactly one of three states is valid: success (Found, no error), not-found (no error, not found), or failure (error, not found). The ambiguous found-plus-error state is rejected by validation.
func Failure ¶
Failure returns a failure outcome for id carrying err. A nil err is treated as an invalid outcome by Validate.
func (Outcome[V]) IsNotFound ¶
IsNotFound reports whether the outcome represents a missing value.
type RequestID ¶
type RequestID uint64
RequestID identifies a single logical request within one BatchRequest.
The zero value is invalid for a dispatched request. IDs are opaque to providers, which must return the same IDs they received; they are scoped to a single BatchRequest and need not be globally unique. No IDs are generated in this release.
type ScalarFunc ¶
ScalarFunc is the signature of a scalar operation: one input, one result.
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
gqlgen
Package gqlgen integrates BatchWeaver request scopes with gqlgen through its public extension and field-interceptor APIs.
|
Package gqlgen integrates BatchWeaver request scopes with gqlgen through its public extension and field-interceptor APIs. |
|
grpcgo
Package grpcgo provides typed BatchWeaver runtime providers for explicit grpc-go batch RPCs.
|
Package grpcgo provides typed BatchWeaver runtime providers for explicit grpc-go batch RPCs. |
|
pgxv5
Package pgxv5 provides typed BatchWeaver runtime providers for pgx v5.
|
Package pgxv5 provides typed BatchWeaver runtime providers for pgx v5. |
|
redisv9
Package redisv9 provides typed BatchWeaver runtime providers for go-redis v9.
|
Package redisv9 provides typed BatchWeaver runtime providers for go-redis v9. |
|
Package bridge is the stable, typed application binary interface (ABI) between BatchWeaver-generated code and the typed runtime.
|
Package bridge is the stable, typed application binary interface (ABI) between BatchWeaver-generated code and the typed runtime. |
|
cmd
|
|
|
batchweaver
command
Command batchweaver is the BatchWeaver command-line entry point.
|
Command batchweaver is the BatchWeaver command-line entry point. |
|
Package config implements BatchWeaver's strict, versioned configuration system: schema version 1, YAML and JSON loading, deterministic includes and merge, centralized defaults, normalization into an operation catalog, semantic validation, canonical rendering, and a semantic digest.
|
Package config implements BatchWeaver's strict, versioned configuration system: schema version 1, YAML and JSON loading, deterministic includes and merge, centralized defaults, normalization into an operation catalog, semantic validation, canonical rendering, and a semantic digest. |
|
Package diagnostics defines the stable, dependency-free data model for diagnostics produced across BatchWeaver: configuration loading, the operation model, analyzers, compiler passes, runtime adapters, and verification tooling.
|
Package diagnostics defines the stable, dependency-free data model for diagnostics produced across BatchWeaver: configuration loading, the operation model, analyzers, compiler passes, runtime adapters, and verification tooling. |
|
examples
|
|
|
adaptive-runtime
Package adaptiveruntime demonstrates BatchWeaver's bounded, explainable adaptive controller.
|
Package adaptiveruntime demonstrates BatchWeaver's bounded, explainable adaptive controller. |
|
declarations/basic
Package basic is a compile-tested example of declaring a BatchWeaver operation.
|
Package basic is a compile-tested example of declaring a BatchWeaver operation. |
|
fairness-overload
Package fairnessoverload demonstrates BatchWeaver's fairness scheduling and overload control.
|
Package fairnessoverload demonstrates BatchWeaver's fairness scheduling and overload control. |
|
multi-operation-wave
Package multioperationwave demonstrates BatchWeaver's multi-operation wave planning.
|
Package multioperationwave demonstrates BatchWeaver's multi-operation wave planning. |
|
recursive-batching
Package recursivebatching demonstrates BatchWeaver's recursive breadth-first batching.
|
Package recursivebatching demonstrates BatchWeaver's recursive breadth-first batching. |
|
static-prefetch
Package staticprefetch demonstrates the BatchWeaver static-loop-prefetch transformation.
|
Package staticprefetch demonstrates the BatchWeaver static-loop-prefetch transformation. |
|
static-prefetch/repo
Package repo is an in-memory user store for the static-prefetch example.
|
Package repo is an in-memory user store for the static-prefetch example. |
|
internal
|
|
|
adapter
Package adapter implements BatchWeaver's backend adapter SDK: a versioned, deterministic model of backend integrations (manifests, capabilities, bindings) and production adapter logic — exact/composite-key PostgreSQL read-batch synthesis with bounded joins over database/sql contracts, Redis cluster hash-slot grouping, and scalar/batch contract verification.
|
Package adapter implements BatchWeaver's backend adapter SDK: a versioned, deterministic model of backend integrations (manifests, capabilities, bindings) and production adapter logic — exact/composite-key PostgreSQL read-batch synthesis with bounded joins over database/sql contracts, Redis cluster hash-slot grouping, and scalar/batch contract verification. |
|
adaptive
Package adaptive implements BatchWeaver's production optimization and control layer: privacy-safe workload profiling, versioned cost models, a bounded and explainable adaptive scheduler controller, multi-operation execution waves, recursive breadth-first batching for proven traversals, fairness and tenant quotas, overload detection with admission control and load shedding, and deterministic offline replay, simulation, and reporting.
|
Package adaptive implements BatchWeaver's production optimization and control layer: privacy-safe workload profiling, versioned cost models, a bounded and explainable adaptive scheduler controller, multi-operation execution waves, recursive breadth-first batching for proven traversals, fairness and tenant quotas, overload detection with admission control and load shedding, and deterministic offline replay, simulation, and reporting. |
|
analysis
Package analysis implements BatchWeaver's static discovery and analysis foundation: it loads real Go programs, builds canonical identities, discovers operation declarations, constructs SSA and a conservative call graph, summarizes observable effects, indexes scalar-operation call sites, and produces a deterministic, versioned analysis snapshot.
|
Package analysis implements BatchWeaver's static discovery and analysis foundation: it loads real Go programs, builds canonical identities, discovers operation declarations, constructs SSA and a conservative call graph, summarizes observable effects, indexes scalar-operation call sites, and produces a deterministic, versioned analysis snapshot. |
|
analysiscache
Package analysiscache implements the bounded, content-addressed cache used by the local workspace daemon.
|
Package analysiscache implements the bounded, content-addressed cache used by the local workspace daemon. |
|
assurance
Package assurance contains executable release-candidate verification models.
|
Package assurance contains executable release-candidate verification models. |
|
buildinfo
Package buildinfo exposes a stable, deterministic model of the information that identifies a BatchWeaver build: its version, source revision, build timestamp, and the toolchain and platform it was produced with.
|
Package buildinfo exposes a stable, deterministic model of the information that identifies a BatchWeaver build: its version, source revision, build timestamp, and the toolchain and platform it was produced with. |
|
cli
Package cli implements BatchWeaver's command-line interface using only the standard library.
|
Package cli implements BatchWeaver's command-line interface using only the standard library. |
|
configdecode
Package configdecode converts YAML and JSON configuration bytes into a uniform, position-aware node tree and provides strict decoding primitives on top of it.
|
Package configdecode converts YAML and JSON configuration bytes into a uniform, position-aware node tree and provides strict decoding primitives on top of it. |
|
configload
Package configload discovers, reads, and include-expands BatchWeaver configuration files into a single merged node tree.
|
Package configload discovers, reads, and include-expands BatchWeaver configuration files into a single merged node tree. |
|
configmerge
Package configmerge merges decoded configuration node trees according to BatchWeaver's documented version-1 merge semantics.
|
Package configmerge merges decoded configuration node trees according to BatchWeaver's documented version-1 merge semantics. |
|
daemon
Package daemon implements BatchWeaver's optional local workspace daemon: a per-workspace process that CLI, LSP, and editor integrations can share to avoid recomputing expensive analysis.
|
Package daemon implements BatchWeaver's optional local workspace daemon: a per-workspace process that CLI, LSP, and editor integrations can share to avoid recomputing expensive analysis. |
|
editor
Package editor is BatchWeaver's editor-agnostic service layer.
|
Package editor is BatchWeaver's editor-agnostic service layer. |
|
filesystem
Package filesystem provides a minimal filesystem abstraction used by BatchWeaver's project path resolution.
|
Package filesystem provides a minimal filesystem abstraction used by BatchWeaver's project path resolution. |
|
gocommand
Package gocommand runs the installed Go tool for transformed build, test, and run commands.
|
Package gocommand runs the installed Go tool for transformed build, test, and run commands. |
|
lsp/documents
Package documents maintains the language server's in-memory view of editor buffers: their versions, contents, and the overlay it derives for on-disk analysis.
|
Package documents maintains the language server's in-memory view of editor buffers: their versions, contents, and the overlay it derives for on-disk analysis. |
|
lsp/jsonrpc
Package jsonrpc implements the minimal JSON-RPC 2.0 surface BatchWeaver's language server needs, framed with the Language Server Protocol's Content-Length header convention.
|
Package jsonrpc implements the minimal JSON-RPC 2.0 surface BatchWeaver's language server needs, framed with the Language Server Protocol's Content-Length header convention. |
|
lsp/protocol
Package protocol defines the subset of Language Server Protocol 3.17 types that BatchWeaver's language server and gopls proxy use.
|
Package protocol defines the subset of Language Server Protocol 3.17 types that BatchWeaver's language server and gopls proxy use. |
|
lsp/proxy
Package proxy implements BatchWeaver's optional gopls-compatible LSP proxy.
|
Package proxy implements BatchWeaver's optional gopls-compatible LSP proxy. |
|
lsp/server
Package server implements BatchWeaver's standalone Language Server Protocol server.
|
Package server implements BatchWeaver's standalone Language Server Protocol server. |
|
project
Package project resolves BatchWeaver's project locations, most importantly the repository root, without assuming any particular current working directory.
|
Package project resolves BatchWeaver's project locations, most importantly the repository root, without assuming any particular current working directory. |
|
proof
Package proof implements BatchWeaver's semantic batching proof engine.
|
Package proof implements BatchWeaver's semantic batching proof engine. |
|
release
Package release implements BatchWeaver's non-publishing release assurance pipeline.
|
Package release implements BatchWeaver's non-publishing release assurance pipeline. |
|
textdistance
Package textdistance provides a small, standard-library-only edit-distance implementation used to suggest corrections for misspelled configuration field names.
|
Package textdistance provides a small, standard-library-only edit-distance implementation used to suggest corrections for misspelled configuration field names. |
|
transform
Package transform implements BatchWeaver's first end-to-end transformation path: consuming semantic proof certificates, planning deterministic source-preserving rewrites, generating the first production transformation (static slice/array loop prefetch for certified read-only operations), and executing transformed code through Go build overlays without modifying the source tree.
|
Package transform implements BatchWeaver's first end-to-end transformation path: consuming semantic proof certificates, planning deterministic source-preserving rewrites, generating the first production transformation (static slice/array loop prefetch for certified read-only operations), and executing transformed code through Go build overlays without modifying the source tree. |
|
Package operation defines BatchWeaver's canonical operation domain model: the stable identifiers, Go symbol references, semantic policies, and contracts that describe how a scalar operation relates to its batch equivalent.
|
Package operation defines BatchWeaver's canonical operation domain model: the stable identifiers, Go symbol references, semantic policies, and contracts that describe how a scalar operation relates to its batch equivalent. |
|
Package runtime is BatchWeaver's explicit, typed request-coalescing runtime.
|
Package runtime is BatchWeaver's explicit, typed request-coalescing runtime. |