{
  "id": "@typed/fx/Push#exhaustMapEffect",
  "canonicalId": "@typed/fx/Push#exhaustMapEffect",
  "symbol": {
    "id": "@typed/fx/Push#exhaustMapEffect",
    "packageName": "@typed/fx",
    "moduleName": "Push",
    "exportName": "exhaustMapEffect",
    "kind": "constant",
    "signatures": [
      "export declare const exhaustMapEffect: {\n    <B, C, E3, R3>(f: (b: B) => Effect.Effect<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) => Effect.Effect<C, E3, R3>): Push<A, E, R, C, E2 | E3, R2 | R3 | Scope.Scope>;\n};"
    ],
    "summary": "Runs at most one mapped Effect and ignores values while it is active.\n\nThe first value while idle starts one Effect and can emit one result; all values\nreceived before it completes are dropped. The mapping callback is still invoked\nand constructs an Effect for every value before the busy check; dropped Effects\nare not run. The input side is unchanged.",
    "sections": {
      "Why": "This guards non-overlapping Effect work without manual busy state.",
      "Ownership and lifetime": "The output Scope owns and joins the active Effect fiber. Subscription\ninterruption stops it and runs finalizers. Its errors and services join the\noutput channels; no value is buffered for later."
    },
    "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 finalized: Array<number> = []\nconst push = Push.make(\n  Sink.make(() => Effect.void, (_: string) => Effect.void),\n  Fx.fromIterable([1, 2])\n)\nconst saving = Push.exhaustMapEffect(push, (id) => {\n  constructed.push(id)\n  return Effect.sleep(\"10 millis\").pipe(\n    Effect.as(id),\n    Effect.ensuring(Effect.sync(() => finalized.push(id)))\n  )\n})\nconst program = Fx.collectAll(saving).pipe(\n  Effect.map((values) => ({ values, constructed, finalized })),\n  Effect.scoped\n)\n// Effect.runPromise(program) => { values: [1], constructed: [1, 2], finalized: [1] }"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Push/Push.ts",
      "line": 1715
    },
    "since": "1.0.0",
    "category": "Concurrent output work"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Push#exhaustMapEffect",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Push",
    "consumerSpecifier": "@typed/fx/Push",
    "exportName": "exhaustMapEffect",
    "qualifiedName": "exhaustMapEffect",
    "declarationKey": "declaration:53f8ad2a6ed4f7e85446d8d2",
    "family": "variable",
    "signatures": [
      "export declare const exhaustMapEffect: {\n    <B, C, E3, R3>(f: (b: B) => Effect.Effect<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) => Effect.Effect<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": 1715,
          "column": 14
        },
        "end": {
          "line": 1744,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1716,
          "column": 3
        },
        "end": {
          "line": 1720,
          "column": 57
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1721,
          "column": 3
        },
        "end": {
          "line": 1724,
          "column": 55
        }
      }
    ],
    "aliases": [
      "@typed/fx#Push.exhaustMapEffect"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:53f8ad2a6ed4f7e85446d8d2",
    "name": "exhaustMapEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const exhaustMapEffect: {\n    <B, C, E3, R3>(f: (b: B) => Effect.Effect<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) => Effect.Effect<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": 1715,
              "column": 14
            },
            "end": {
              "line": 1744,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<B, C, E3, R3>(f: (b: B) => Effect.Effect<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) => Effect.Effect<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": 1716,
              "column": 3
            },
            "end": {
              "line": 1720,
              "column": 57
            }
          },
          {
            "file": "packages/fx/src/Push/Push.ts",
            "start": {
              "line": 1721,
              "column": 3
            },
            "end": {
              "line": 1724,
              "column": 55
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const exhaustMapEffect: {\n    <B, C, E3, R3>(f: (b: B) => Effect.Effect<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) => Effect.Effect<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 mapped Effect and ignores values while it is active.\n\nThe first value while idle starts one Effect and can emit one result; all values\nreceived before it completes are dropped. The mapping callback is still invoked\nand constructs an Effect for every value before the busy check; dropped Effects\nare not run. The input side is unchanged.",
    "sections": {
      "Why": "This guards non-overlapping Effect work without manual busy state.",
      "Ownership and lifetime": "The output Scope owns and joins the active Effect fiber. Subscription\ninterruption stops it and runs finalizers. Its errors and services join the\noutput channels; no value is buffered for later."
    },
    "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 finalized: Array<number> = []\nconst push = Push.make(\n  Sink.make(() => Effect.void, (_: string) => Effect.void),\n  Fx.fromIterable([1, 2])\n)\nconst saving = Push.exhaustMapEffect(push, (id) => {\n  constructed.push(id)\n  return Effect.sleep(\"10 millis\").pipe(\n    Effect.as(id),\n    Effect.ensuring(Effect.sync(() => finalized.push(id)))\n  )\n})\nconst program = Fx.collectAll(saving).pipe(\n  Effect.map((values) => ({ values, constructed, finalized })),\n  Effect.scoped\n)\n// Effect.runPromise(program) => { values: [1], constructed: [1, 2], finalized: [1] }"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1715,
          "column": 14
        },
        "end": {
          "line": 1744,
          "column": 3
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1716,
          "column": 3
        },
        "end": {
          "line": 1720,
          "column": 57
        }
      },
      {
        "file": "packages/fx/src/Push/Push.ts",
        "start": {
          "line": 1721,
          "column": 3
        },
        "end": {
          "line": 1724,
          "column": 55
        }
      }
    ],
    "since": "1.0.0",
    "category": "Concurrent output work"
  }
}
