{
  "id": "@typed/fx/Fx#exhaustMap",
  "canonicalId": "@typed/fx/Fx#exhaustMap",
  "symbol": {
    "id": "@typed/fx/Fx#exhaustMap",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "exhaustMap",
    "kind": "constant",
    "signatures": [
      "export declare const exhaustMap: FlatMapLike;"
    ],
    "summary": "Maps each element of an Fx to a new Fx, ignoring new elements until the current inner Fx completes.",
    "sections": {
      "Why": "`exhaustMap` is an admission policy for work that must never overlap and does\nnot need a backlog, such as ignoring repeated submit events while one submit\nis running.",
      "Admission, ordering, and cardinality": "The first source value observed while idle admits one inner Fx. For values\narriving while it runs, `f` is still evaluated to construct an inner, but that\ninner is not run and no value is queued. Every admitted inner may emit any\nnumber of values in its own order.",
      "Ownership and lifetime": "Source and admitted-inner failures are forwarded and their services remain\ntyped. A `FiberHandle` in the required `Scope` owns the active inner. Source\ncompletion waits for that inner; interruption closes the handle and the\ninner's child Scope, running its finalizers."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst submits = Fx.mergeAll(\n  Fx.at(\"first\", \"0 millis\"),\n  Fx.at(\"ignored while busy\", \"5 millis\"),\n  Fx.at(\"later\", \"30 millis\")\n)\nconst accepted = Fx.exhaustMap(submits, (command) => Fx.at(command, \"20 millis\"))\n\nEffect.runPromise(Effect.scoped(Fx.collectAll(accepted))).then(console.log)\n// [\"first\", \"later\"]"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/exhaustMap.ts",
      "line": 56
    },
    "since": "1.0.0",
    "category": "Concurrent work"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#exhaustMap",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "exhaustMap",
    "qualifiedName": "exhaustMap",
    "declarationKey": "declaration:02ddfaa9b8a06ee554f3a13c",
    "family": "variable",
    "signatures": [
      "export declare const exhaustMap: FlatMapLike;"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/exhaustMap.ts",
        "start": {
          "line": 56,
          "column": 14
        },
        "end": {
          "line": 73,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.exhaustMap"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:02ddfaa9b8a06ee554f3a13c",
    "name": "exhaustMap",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const exhaustMap: FlatMapLike;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/exhaustMap.ts",
            "start": {
              "line": 56,
              "column": 14
            },
            "end": {
              "line": 73,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const exhaustMap: FlatMapLike;"
    ],
    "typeParameters": [],
    "summary": "Maps each element of an Fx to a new Fx, ignoring new elements until the current inner Fx completes.",
    "sections": {
      "Why": "`exhaustMap` is an admission policy for work that must never overlap and does\nnot need a backlog, such as ignoring repeated submit events while one submit\nis running.",
      "Admission, ordering, and cardinality": "The first source value observed while idle admits one inner Fx. For values\narriving while it runs, `f` is still evaluated to construct an inner, but that\ninner is not run and no value is queued. Every admitted inner may emit any\nnumber of values in its own order.",
      "Ownership and lifetime": "Source and admitted-inner failures are forwarded and their services remain\ntyped. A `FiberHandle` in the required `Scope` owns the active inner. Source\ncompletion waits for that inner; interruption closes the handle and the\ninner's child Scope, running its finalizers."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport { Effect } from \"effect\"\n\nconst submits = Fx.mergeAll(\n  Fx.at(\"first\", \"0 millis\"),\n  Fx.at(\"ignored while busy\", \"5 millis\"),\n  Fx.at(\"later\", \"30 millis\")\n)\nconst accepted = Fx.exhaustMap(submits, (command) => Fx.at(command, \"20 millis\"))\n\nEffect.runPromise(Effect.scoped(Fx.collectAll(accepted))).then(console.log)\n// [\"first\", \"later\"]"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/exhaustMap.ts",
        "start": {
          "line": 56,
          "column": 14
        },
        "end": {
          "line": 73,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Concurrent work"
  }
}
