{
  "id": "@typed/fx#Fx.raceAll",
  "canonicalId": "@typed/fx/Fx#raceAll",
  "symbol": {
    "id": "@typed/fx#Fx.raceAll",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.raceAll",
    "kind": "constant",
    "signatures": [
      "export declare const raceAll: <FX extends ReadonlyArray<Fx<any, any, any>>>(...fxs: FX) => Fx<Fx.Success<FX[number]>, Fx.Error<FX[number]>, Fx.Services<FX[number]>>;"
    ],
    "summary": "Races many streams: the first to emit wins and the rest are interrupted.",
    "sections": {
      "Why": "`raceAll` extends {@link race} to a runtime-sized set while preserving the\nfirst-value selection rule.",
      "Selection, ordering, and cardinality": "All inputs start concurrently. The first emitted value selects one input and\nonly that input's values are forwarded afterward. Zero inputs produce the\nempty Fx; one input is returned unchanged. No result buffer is retained.",
      "Ownership and lifetime": "Before selection, the first non-interruption failure is retained and reported\nonly if every input ends without emitting. After selection, winner failures\nare forwarded. All environments are required. Losers are interrupted and the\nobserving fiber owns cleanup for every child."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst response = Fx.raceAll(\n  Fx.at(\"cache\", \"30 millis\"),\n  Fx.at(\"primary\", \"5 millis\"),\n  Fx.at(\"replica\", \"20 millis\")\n)\nEffect.runPromise(Fx.collectAll(response)).then(console.log)\n// [\"primary\"]"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/race.ts",
      "line": 111
    },
    "since": "1.0.0",
    "category": "Concurrent work"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.raceAll",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.raceAll",
    "declarationKey": "declaration:f454d907981d2d0bbee42cd0",
    "family": "variable",
    "signatures": [
      "export declare const raceAll: <FX extends ReadonlyArray<Fx<any, any, any>>>(...fxs: FX) => Fx<Fx.Success<FX[number]>, Fx.Error<FX[number]>, Fx.Services<FX[number]>>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/race.ts",
        "start": {
          "line": 111,
          "column": 14
        },
        "end": {
          "line": 201,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#raceAll"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:f454d907981d2d0bbee42cd0"
  },
  "declaration": {
    "declarationKey": "declaration:f454d907981d2d0bbee42cd0",
    "name": "raceAll",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const raceAll: <FX extends ReadonlyArray<Fx<any, any, any>>>(...fxs: FX) => Fx<Fx.Success<FX[number]>, Fx.Error<FX[number]>, Fx.Services<FX[number]>>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/race.ts",
            "start": {
              "line": 111,
              "column": 14
            },
            "end": {
              "line": 201,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const raceAll: <FX extends ReadonlyArray<Fx<any, any, any>>>(...fxs: FX) => Fx<Fx.Success<FX[number]>, Fx.Error<FX[number]>, Fx.Services<FX[number]>>;"
    ],
    "typeParameters": [],
    "summary": "Races many streams: the first to emit wins and the rest are interrupted.",
    "sections": {
      "Why": "`raceAll` extends {@link race} to a runtime-sized set while preserving the\nfirst-value selection rule.",
      "Selection, ordering, and cardinality": "All inputs start concurrently. The first emitted value selects one input and\nonly that input's values are forwarded afterward. Zero inputs produce the\nempty Fx; one input is returned unchanged. No result buffer is retained.",
      "Ownership and lifetime": "Before selection, the first non-interruption failure is retained and reported\nonly if every input ends without emitting. After selection, winner failures\nare forwarded. All environments are required. Losers are interrupted and the\nobserving fiber owns cleanup for every child."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst response = Fx.raceAll(\n  Fx.at(\"cache\", \"30 millis\"),\n  Fx.at(\"primary\", \"5 millis\"),\n  Fx.at(\"replica\", \"20 millis\")\n)\nEffect.runPromise(Fx.collectAll(response)).then(console.log)\n// [\"primary\"]"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/race.ts",
        "start": {
          "line": 111,
          "column": 14
        },
        "end": {
          "line": 201,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Concurrent work"
  }
}
