{
  "id": "@typed/fx#Push.exhaustMap",
  "canonicalId": "@typed/fx/Push#exhaustMap",
  "symbol": {
    "id": "@typed/fx#Push.exhaustMap",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Push.exhaustMap",
    "kind": "constant",
    "signatures": [
      "export declare const exhaustMap: {\n    <B, C, E3, R3>(f: (b: B) => Fx.Fx<C, E3, R3>): <A, E, R, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n    <A, E, R, B, E2, R2, C, E3, R3>(push: Push<A, E, R, B, E2, R2>, f: (b: B) => Fx.Fx<C, E3, R3>): Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n};"
    ],
    "summary": "Runs at most one inner Fx and ignores outer values while it is active.\n\nThe first value seen while idle starts an inner; every value arriving before\nthat inner completes is dropped. `f(value)` is still evaluated and its inner Fx\nis constructed before the busy check; dropping means the returned Fx is not\nrun. Accepted inners preserve their own order and all values. Input is unchanged.",
    "sections": {
      "Why": "Exhaust semantics prevent duplicate work, such as repeated submit clicks, while\nallowing another request after the active one completes.",
      "Ownership and lifetime": "The output Scope owns the active inner fiber, joins it before completion, and\ninterrupts it with the subscription. Inner failures and services join the\nouter channels; there is no pending-value buffer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Fx from \"@typed/fx/Fx\"\nimport * as Push from \"@typed/fx/Push\"\nimport * as Sink from \"@typed/fx/Sink\"\n\nconst constructed: Array<number> = []\nconst started: Array<number> = []\nconst finalized: Array<number> = []\nconst push = Push.make(\n  Sink.make(() => Effect.void, (_: string) => Effect.void),\n  Fx.fromIterable([1, 2])\n)\nconst exhausted = Push.exhaustMap(push, (id) => {\n  constructed.push(id)\n  return Fx.make<number>((sink) =>\n    Effect.gen(function* () {\n      yield* Effect.sync(() => started.push(id))\n      yield* Effect.sleep(\"5 millis\")\n      yield* sink.onSuccess(id * 10 + 1)\n      yield* Effect.sleep(\"5 millis\")\n      yield* sink.onSuccess(id * 10 + 2)\n    }).pipe(Effect.ensuring(Effect.sync(() => finalized.push(id))))\n  )\n})\nconst program = Fx.collectAll(exhausted).pipe(\n  Effect.map((values) => ({ values, constructed, started, finalized })),\n  Effect.scoped\n)\n// => { values: [11, 12], constructed: [1, 2], started: [1], finalized: [1] }"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Push/Push.ts",
      "line": 1635
    },
    "since": "1.0.0",
    "category": "Concurrent output work"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Push.exhaustMap",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Push",
    "qualifiedName": "Push.exhaustMap",
    "declarationKey": "declaration:83a8ab461ab9f90c1f8cd400",
    "family": "variable",
    "signatures": [
      "export declare const exhaustMap: {\n    <B, C, E3, R3>(f: (b: B) => Fx.Fx<C, E3, R3>): <A, E, R, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n    <A, E, R, B, E2, R2, C, E3, R3>(push: Push<A, E, R, B, E2, R2>, f: (b: B) => Fx.Fx<C, E3, R3>): Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1635,
          "column": 14
        },
        "end": {
          "line": 1664,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1636,
          "column": 3
        },
        "end": {
          "line": 1640,
          "column": 57
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1641,
          "column": 3
        },
        "end": {
          "line": 1644,
          "column": 55
        }
      }
    ],
    "aliases": [
      "@typed/fx/Push#exhaustMap"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Push",
    "static": false,
    "importedFrom": "declaration:83a8ab461ab9f90c1f8cd400"
  },
  "declaration": {
    "declarationKey": "declaration:83a8ab461ab9f90c1f8cd400",
    "name": "exhaustMap",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const exhaustMap: {\n    <B, C, E3, R3>(f: (b: B) => Fx.Fx<C, E3, R3>): <A, E, R, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n    <A, E, R, B, E2, R2, C, E3, R3>(push: Push<A, E, R, B, E2, R2>, f: (b: B) => Fx.Fx<C, E3, R3>): Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 1635,
              "column": 14
            },
            "end": {
              "line": 1664,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<B, C, E3, R3>(f: (b: B) => Fx.Fx<C, E3, R3>): <A, E, R, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;",
          "<A, E, R, B, E2, R2, C, E3, R3>(push: Push<A, E, R, B, E2, R2>, f: (b: B) => Fx.Fx<C, E3, R3>): Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;"
        ],
        "typeParameters": [
          "B",
          "C",
          "E3",
          "R3",
          "A",
          "E",
          "R",
          "E2",
          "R2"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 1636,
              "column": 3
            },
            "end": {
              "line": 1640,
              "column": 57
            }
          },
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 1641,
              "column": 3
            },
            "end": {
              "line": 1644,
              "column": 55
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const exhaustMap: {\n    <B, C, E3, R3>(f: (b: B) => Fx.Fx<C, E3, R3>): <A, E, R, E2, R2>(push: Push<A, E, R, B, E2, R2>) => Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n    <A, E, R, B, E2, R2, C, E3, R3>(push: Push<A, E, R, B, E2, R2>, f: (b: B) => Fx.Fx<C, E3, R3>): Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n};"
    ],
    "typeParameters": [
      "B",
      "C",
      "E3",
      "R3",
      "A",
      "E",
      "R",
      "E2",
      "R2"
    ],
    "summary": "Runs at most one inner Fx and ignores outer values while it is active.\n\nThe first value seen while idle starts an inner; every value arriving before\nthat inner completes is dropped. `f(value)` is still evaluated and its inner Fx\nis constructed before the busy check; dropping means the returned Fx is not\nrun. Accepted inners preserve their own order and all values. Input is unchanged.",
    "sections": {
      "Why": "Exhaust semantics prevent duplicate work, such as repeated submit clicks, while\nallowing another request after the active one completes.",
      "Ownership and lifetime": "The output Scope owns the active inner fiber, joins it before completion, and\ninterrupts it with the subscription. Inner failures and services join the\nouter channels; there is no pending-value buffer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Fx from \"@typed/fx/Fx\"\nimport * as Push from \"@typed/fx/Push\"\nimport * as Sink from \"@typed/fx/Sink\"\n\nconst constructed: Array<number> = []\nconst started: Array<number> = []\nconst finalized: Array<number> = []\nconst push = Push.make(\n  Sink.make(() => Effect.void, (_: string) => Effect.void),\n  Fx.fromIterable([1, 2])\n)\nconst exhausted = Push.exhaustMap(push, (id) => {\n  constructed.push(id)\n  return Fx.make<number>((sink) =>\n    Effect.gen(function* () {\n      yield* Effect.sync(() => started.push(id))\n      yield* Effect.sleep(\"5 millis\")\n      yield* sink.onSuccess(id * 10 + 1)\n      yield* Effect.sleep(\"5 millis\")\n      yield* sink.onSuccess(id * 10 + 2)\n    }).pipe(Effect.ensuring(Effect.sync(() => finalized.push(id))))\n  )\n})\nconst program = Fx.collectAll(exhausted).pipe(\n  Effect.map((values) => ({ values, constructed, started, finalized })),\n  Effect.scoped\n)\n// => { values: [11, 12], constructed: [1, 2], started: [1], finalized: [1] }"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1635,
          "column": 14
        },
        "end": {
          "line": 1664,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1636,
          "column": 3
        },
        "end": {
          "line": 1640,
          "column": 57
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1641,
          "column": 3
        },
        "end": {
          "line": 1644,
          "column": 55
        }
      }
    ],
    "since": "1.0.0",
    "category": "Concurrent output work"
  }
}
