<A, E>(results: ReadonlyArray<NodeResult<A, E>>): Record<
string,
Exit.Exit<A, E>
>Every peer exit keyed by node — keeps failures. Use this when silence would lie (fleet
health): map Exit → wire (Reachable / Unreachable) yourself. Contrast
combineByNode, which drops failed peers (fine for optional metric folds).
export const const combineByNodeExit: <A, E>(
results: ReadonlyArray<NodeResult<A, E>>
) => Record<string, Exit.Exit<A, E>>
Every peer exit keyed by node — keeps failures. Use this when silence would lie (fleet
health): map Exit → wire (Reachable / Unreachable) yourself. Contrast
combineByNode
, which drops failed peers (fine for optional metric folds).
combineByNodeExit = <function (type parameter) A in <A, E>(results: ReadonlyArray<NodeResult<A, E>>): Record<string, Exit.Exit<A, E>>A, function (type parameter) E in <A, E>(results: ReadonlyArray<NodeResult<A, E>>): Record<string, Exit.Exit<A, E>>E>(
results: ReadonlyArray<NodeResult<A, E>>results: interface ReadonlyArray<T>ReadonlyArray<interface NodeResult<A, E = never>One node's outcome for a gathered query field — node-attributed success/failure.
NodeResult<function (type parameter) A in <A, E>(results: ReadonlyArray<NodeResult<A, E>>): Record<string, Exit.Exit<A, E>>A, function (type parameter) E in <A, E>(results: ReadonlyArray<NodeResult<A, E>>): Record<string, Exit.Exit<A, E>>E>>,
): type Record<K extends keyof any, T> = {
[P in K]: T
}
Construct a type with a set of properties K of type T
Record<string, import ExitExit.type Exit<A, E = never> = Exit.Success<A, E> | Exit.Failure<A, E>Represents the result of an Effect computation.
When to use
Use when you need to synchronously inspect whether an Effect computation
succeeded or failed.
Details
An Exit<A, E> is either Success<A, E> containing a value of type A, or
Failure<A, E> containing a Cause<E> describing why the computation
failed.
Since Exit is also an Effect, you can yield it inside Effect.gen.
Example (Pattern matching on an Exit)
import { Exit } from "effect"
const success: Exit.Exit<number> = Exit.succeed(42)
const failure: Exit.Exit<number, string> = Exit.fail("error")
const result = Exit.match(success, {
onSuccess: (value) => `Got value: ${value}`,
onFailure: (cause) => `Got error: ${cause}`
})
Namespace containing helper types shared by Exit values.
When to use
Use to reference helper types that describe the shared structure of Exit
values.
Exit<function (type parameter) A in <A, E>(results: ReadonlyArray<NodeResult<A, E>>): Record<string, Exit.Exit<A, E>>A, function (type parameter) E in <A, E>(results: ReadonlyArray<NodeResult<A, E>>): Record<string, Exit.Exit<A, E>>E>> =>
var Object: ObjectConstructorProvides functionality common to all JavaScript objects.
Object.ObjectConstructor.fromEntries<Exit.Exit<A, E>>(entries: Iterable<readonly [PropertyKey, Exit.Exit<A, E>]>): {
[k: string]: Exit.Exit<A, E>;
} (+1 overload)
Returns an object created by key-value entries for properties and methods
fromEntries(results: ReadonlyArray<NodeResult<A, E>>results.ReadonlyArray<NodeResult<A, E>>.map<[string, Exit.Exit<A, E>]>(callbackfn: (value: NodeResult<A, E>, index: number, array: readonly NodeResult<A, E>[]) => [string, Exit.Exit<A, E>], thisArg?: any): [string, Exit.Exit<A, E>][]Calls a defined callback function on each element of an array, and returns an array that contains the results.
map((r: NodeResult<A, E>(parameter) r: {
node: string;
exit: Exit.Exit<A, E>;
}
r) => [r: NodeResult<A, E>(parameter) r: {
node: string;
exit: Exit.Exit<A, E>;
}
r.NodeResult<A, E>.node: stringnode, r: NodeResult<A, E>(parameter) r: {
node: string;
exit: Exit.Exit<A, E>;
}
r.NodeResult<A, E>.exit: Exit.Exit<A, E>exit]));