effect 4.0.4 → 4.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-docs/package.json +1 -1
- package/ai-docs/src/06_schedule/10_schedules.ts +5 -4
- package/ai-docs/src/52_graphql/10_basics.ts +19 -13
- package/ai-docs/src/52_graphql/30_batching.ts +6 -4
- package/ai-docs/src/52_graphql/40_aliased-batching.ts +6 -4
- package/ai-docs/tsconfig.json +3 -1
- package/dist/Array.d.ts +207 -58
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +45 -22
- package/dist/Array.js.map +1 -1
- package/dist/Bytes.d.ts +79 -0
- package/dist/Bytes.d.ts.map +1 -0
- package/dist/Bytes.js +109 -0
- package/dist/Bytes.js.map +1 -0
- package/dist/Channel.d.ts +187 -14
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +142 -33
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +39 -21
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +26 -17
- package/dist/Chunk.js.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +8 -3
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +34 -32
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Cron.d.ts +2 -2
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +6 -3
- package/dist/Cron.js.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +58 -21
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +548 -182
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +261 -76
- package/dist/Effect.js.map +1 -1
- package/dist/Equivalence.d.ts +2 -1
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +12 -8
- package/dist/Equivalence.js.map +1 -1
- package/dist/Exit.d.ts +24 -9
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -3
- package/dist/Exit.js.map +1 -1
- package/dist/FiberHandle.d.ts +2 -0
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +9 -4
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +2 -0
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +5 -2
- package/dist/FiberMap.js.map +1 -1
- package/dist/FileSystem.d.ts +28 -9
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js.map +1 -1
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +18 -17
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonSchema.d.ts +9 -3
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +19 -3
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +2 -2
- package/dist/Layer.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +19 -1
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +62 -6
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +20 -6
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +2 -2
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +132 -0
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +197 -25
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/Number.js +2 -2
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js.map +1 -1
- package/dist/Path.d.ts +37 -5
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +44 -6
- package/dist/Path.js.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +12 -7
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +4 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +4 -1
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +1 -1
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +12 -7
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +9 -6
- package/dist/RcMap.js.map +1 -1
- package/dist/Record.d.ts +51 -0
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +17 -0
- package/dist/Record.js.map +1 -1
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +5 -4
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +5 -4
- package/dist/References.js.map +1 -1
- package/dist/RequestResolver.d.ts +31 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +39 -4
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.js +1 -1
- package/dist/Resource.js.map +1 -1
- package/dist/Runtime.d.ts +3 -3
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +18 -15
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +383 -326
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +338 -17
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +5 -5
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +24 -8
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +8 -3
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +15 -5
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +4 -4
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +29 -51
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +56 -1
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +18 -0
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +1 -1
- package/dist/SchemaTransformation.js +1 -1
- package/dist/Scope.d.ts +12 -2
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +5 -0
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +10 -7
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +9 -5
- package/dist/ScopedCache.js.map +1 -1
- package/dist/SemVer.d.ts +1196 -0
- package/dist/SemVer.d.ts.map +1 -0
- package/dist/SemVer.js +756 -0
- package/dist/SemVer.js.map +1 -0
- package/dist/SemVerRange.d.ts +559 -0
- package/dist/SemVerRange.d.ts.map +1 -0
- package/dist/SemVerRange.js +551 -0
- package/dist/SemVerRange.js.map +1 -0
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +6 -2
- package/dist/Sink.js.map +1 -1
- package/dist/Stream.d.ts +235 -8
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +145 -60
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +16 -2
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +25 -10
- package/dist/String.js.map +1 -1
- package/dist/TextDiff.d.ts +399 -0
- package/dist/TextDiff.d.ts.map +1 -0
- package/dist/TextDiff.js +634 -0
- package/dist/TextDiff.js.map +1 -0
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +3 -2
- package/dist/TxRef.js.map +1 -1
- package/dist/ai/AiError.d.ts +78 -14
- package/dist/ai/AiError.d.ts.map +1 -1
- package/dist/ai/AiError.js +51 -3
- package/dist/ai/AiError.js.map +1 -1
- package/dist/ai/Chat.d.ts +1 -2
- package/dist/ai/Chat.d.ts.map +1 -1
- package/dist/ai/Chat.js +6 -3
- package/dist/ai/Chat.js.map +1 -1
- package/dist/ai/Decision.d.ts +116 -20
- package/dist/ai/Decision.d.ts.map +1 -1
- package/dist/ai/Decision.js +37 -3
- package/dist/ai/Decision.js.map +1 -1
- package/dist/ai/DecisionModel.d.ts +129 -11
- package/dist/ai/DecisionModel.d.ts.map +1 -1
- package/dist/ai/DecisionModel.js +183 -95
- package/dist/ai/DecisionModel.js.map +1 -1
- package/dist/ai/EmbeddingModel.d.ts +10 -0
- package/dist/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/ai/EmbeddingModel.js +21 -7
- package/dist/ai/EmbeddingModel.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +47 -35
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpClient.d.ts +289 -0
- package/dist/ai/McpClient.d.ts.map +1 -0
- package/dist/ai/McpClient.js +819 -0
- package/dist/ai/McpClient.js.map +1 -0
- package/dist/ai/McpClientError.d.ts +254 -0
- package/dist/ai/McpClientError.d.ts.map +1 -0
- package/dist/ai/McpClientError.js +260 -0
- package/dist/ai/McpClientError.js.map +1 -0
- package/dist/ai/McpProtocol.d.ts +2 -2
- package/dist/ai/McpProtocol.d.ts.map +1 -1
- package/dist/ai/McpSchema.d.ts +368 -235
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpSchema.js +94 -24
- package/dist/ai/McpSchema.js.map +1 -1
- package/dist/ai/McpServer.d.ts +6 -52
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +27 -50
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Prompt.d.ts +22 -20
- package/dist/ai/Prompt.d.ts.map +1 -1
- package/dist/ai/Prompt.js +23 -1
- package/dist/ai/Prompt.js.map +1 -1
- package/dist/ai/Response.d.ts +148 -4
- package/dist/ai/Response.d.ts.map +1 -1
- package/dist/ai/Response.js +35 -37
- package/dist/ai/Response.js.map +1 -1
- package/dist/ai/Tool.d.ts +12 -4
- package/dist/ai/Tool.d.ts.map +1 -1
- package/dist/ai/Tool.js.map +1 -1
- package/dist/ai/Toolkit.d.ts +48 -1
- package/dist/ai/Toolkit.d.ts.map +1 -1
- package/dist/ai/Toolkit.js +65 -12
- package/dist/ai/Toolkit.js.map +1 -1
- package/dist/ai/index.d.ts +10 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +10 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/internal/mcpCore.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js +1 -1
- package/dist/ai/internal/mcpProtocol/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js +2 -2
- package/dist/ai/internal/mcpProtocol/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js +2 -2
- package/dist/ai/internal/mcpProtocol/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js +4 -7
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js.map +1 -1
- package/dist/ai/internal/mcpProtocol.js +16 -2
- package/dist/ai/internal/mcpProtocol.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +3 -4
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2024_11_05.js +19 -13
- package/dist/ai/internal/mcpSchema/v2024_11_05.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_03_26.js +3 -2
- package/dist/ai/internal/mcpSchema/v2025_03_26.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_06_18.js +7 -7
- package/dist/ai/internal/mcpSchema/v2025_06_18.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2025_11_25.js +8 -8
- package/dist/ai/internal/mcpSchema/v2025_11_25.js.map +1 -1
- package/dist/ai/internal/mcpSchema/v2026_07_28.js +43 -42
- package/dist/ai/internal/mcpSchema/v2026_07_28.js.map +1 -1
- package/dist/cli/CliError.d.ts +42 -2
- package/dist/cli/CliError.d.ts.map +1 -1
- package/dist/cli/CliError.js +44 -5
- package/dist/cli/CliError.js.map +1 -1
- package/dist/cli/Command.d.ts +286 -2
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +107 -6
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/Completions.d.ts +10 -0
- package/dist/cli/Completions.d.ts.map +1 -1
- package/dist/cli/Completions.js.map +1 -1
- package/dist/cli/Flag.d.ts +215 -0
- package/dist/cli/Flag.d.ts.map +1 -1
- package/dist/cli/Flag.js +89 -0
- package/dist/cli/Flag.js.map +1 -1
- package/dist/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/cli/GlobalFlag.js +3 -3
- package/dist/cli/GlobalFlag.js.map +1 -1
- package/dist/cli/Param.d.ts +194 -0
- package/dist/cli/Param.d.ts.map +1 -1
- package/dist/cli/Param.js +86 -0
- package/dist/cli/Param.js.map +1 -1
- package/dist/cli/TerminalCapabilities.d.ts +84 -0
- package/dist/cli/TerminalCapabilities.d.ts.map +1 -0
- package/dist/cli/TerminalCapabilities.js +122 -0
- package/dist/cli/TerminalCapabilities.js.map +1 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/internal/command.d.ts +2 -1
- package/dist/cli/internal/command.d.ts.map +1 -1
- package/dist/cli/internal/command.js +7 -3
- package/dist/cli/internal/command.js.map +1 -1
- package/dist/cli/internal/completions/bash.js +7 -5
- package/dist/cli/internal/completions/bash.js.map +1 -1
- package/dist/cli/internal/completions/descriptor.js +16 -1
- package/dist/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/cli/internal/completions/fish.js +12 -10
- package/dist/cli/internal/completions/fish.js.map +1 -1
- package/dist/cli/internal/completions/powershell.js +20 -10
- package/dist/cli/internal/completions/powershell.js.map +1 -1
- package/dist/cli/internal/completions/zsh.js +15 -8
- package/dist/cli/internal/completions/zsh.js.map +1 -1
- package/dist/cli/internal/formatter.d.ts +2 -0
- package/dist/cli/internal/formatter.d.ts.map +1 -0
- package/dist/cli/internal/formatter.js +15 -0
- package/dist/cli/internal/formatter.js.map +1 -0
- package/dist/cli/internal/lexer.js +24 -10
- package/dist/cli/internal/lexer.js.map +1 -1
- package/dist/cli/internal/parser.js +35 -15
- package/dist/cli/internal/parser.js.map +1 -1
- package/dist/cli/internal/wizard.d.ts.map +1 -1
- package/dist/cli/internal/wizard.js +2 -1
- package/dist/cli/internal/wizard.js.map +1 -1
- package/dist/cluster/ClusterCron.d.ts +29 -1
- package/dist/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/cluster/ClusterCron.js +64 -32
- package/dist/cluster/ClusterCron.js.map +1 -1
- package/dist/cluster/ClusterMetrics.d.ts +143 -7
- package/dist/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/cluster/ClusterMetrics.js +151 -7
- package/dist/cluster/ClusterMetrics.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts +2 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +98 -18
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/Entity.d.ts +2 -0
- package/dist/cluster/Entity.d.ts.map +1 -1
- package/dist/cluster/Entity.js.map +1 -1
- package/dist/cluster/MessageStorage.d.ts +21 -0
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +20 -12
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/Runners.d.ts.map +1 -1
- package/dist/cluster/Runners.js +96 -37
- package/dist/cluster/Runners.js.map +1 -1
- package/dist/cluster/Sharding.d.ts +1 -0
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +95 -32
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/ShardingConfig.d.ts +20 -0
- package/dist/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/cluster/ShardingConfig.js +4 -0
- package/dist/cluster/ShardingConfig.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +40 -50
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts +2 -2
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +10 -4
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +66 -9
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/devtools/DevTools.d.ts +3 -2
- package/dist/devtools/DevTools.d.ts.map +1 -1
- package/dist/devtools/DevTools.js +3 -2
- package/dist/devtools/DevTools.js.map +1 -1
- package/dist/devtools/DevToolsClient.d.ts +11 -0
- package/dist/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/devtools/DevToolsClient.js +31 -4
- package/dist/devtools/DevToolsClient.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +29 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +29 -0
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/Ini.d.ts.map +1 -1
- package/dist/encoding/Ini.js +3 -0
- package/dist/encoding/Ini.js.map +1 -1
- package/dist/encoding/JsonArray.d.ts +270 -0
- package/dist/encoding/JsonArray.d.ts.map +1 -0
- package/dist/encoding/JsonArray.js +691 -0
- package/dist/encoding/JsonArray.js.map +1 -0
- package/dist/encoding/Ndjson.d.ts +43 -4
- package/dist/encoding/Ndjson.d.ts.map +1 -1
- package/dist/encoding/Ndjson.js +169 -18
- package/dist/encoding/Ndjson.js.map +1 -1
- package/dist/encoding/SchemaBinary.d.ts +9 -1
- package/dist/encoding/SchemaBinary.d.ts.map +1 -1
- package/dist/encoding/SchemaBinary.js +12 -19
- package/dist/encoding/SchemaBinary.js.map +1 -1
- package/dist/encoding/Sse.js +1 -1
- package/dist/encoding/Sse.js.map +1 -1
- package/dist/encoding/Tar.d.ts +309 -0
- package/dist/encoding/Tar.d.ts.map +1 -0
- package/dist/encoding/Tar.js +1182 -0
- package/dist/encoding/Tar.js.map +1 -0
- package/dist/encoding/Toml.js +3 -3
- package/dist/encoding/Toml.js.map +1 -1
- package/dist/encoding/Xml.d.ts +464 -0
- package/dist/encoding/Xml.d.ts.map +1 -0
- package/dist/encoding/Xml.js +1619 -0
- package/dist/encoding/Xml.js.map +1 -0
- package/dist/encoding/Yaml.d.ts +6 -2
- package/dist/encoding/Yaml.d.ts.map +1 -1
- package/dist/encoding/Yaml.js +97 -34
- package/dist/encoding/Yaml.js.map +1 -1
- package/dist/encoding/Zip.d.ts +413 -0
- package/dist/encoding/Zip.d.ts.map +1 -0
- package/dist/encoding/Zip.js +1255 -0
- package/dist/encoding/Zip.js.map +1 -0
- package/dist/encoding/index.d.ts +20 -0
- package/dist/encoding/index.d.ts.map +1 -1
- package/dist/encoding/index.js +20 -0
- package/dist/encoding/index.js.map +1 -1
- package/dist/eventlog/EventJournal.d.ts +90 -5
- package/dist/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/eventlog/EventJournal.js +488 -228
- package/dist/eventlog/EventJournal.js.map +1 -1
- package/dist/eventlog/EventLog.d.ts +180 -12
- package/dist/eventlog/EventLog.d.ts.map +1 -1
- package/dist/eventlog/EventLog.js +394 -146
- package/dist/eventlog/EventLog.js.map +1 -1
- package/dist/eventlog/EventLogEncryption.d.ts +36 -30
- package/dist/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/eventlog/EventLogEncryption.js +97 -38
- package/dist/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/eventlog/EventLogMessage.d.ts +74 -34
- package/dist/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/eventlog/EventLogMessage.js +45 -11
- package/dist/eventlog/EventLogMessage.js.map +1 -1
- package/dist/eventlog/EventLogRemote.d.ts +45 -8
- package/dist/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/eventlog/EventLogRemote.js +51 -14
- package/dist/eventlog/EventLogRemote.js.map +1 -1
- package/dist/eventlog/EventLogServer.d.ts +46 -3
- package/dist/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/eventlog/EventLogServer.js +119 -19
- package/dist/eventlog/EventLogServer.js.map +1 -1
- package/dist/eventlog/EventLogServerEncrypted.d.ts +23 -33
- package/dist/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/eventlog/EventLogServerEncrypted.js +97 -70
- package/dist/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/eventlog/EventLogServerUnencrypted.d.ts +39 -5
- package/dist/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/eventlog/EventLogServerUnencrypted.js +151 -69
- package/dist/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/eventlog/EventRow.d.ts +288 -0
- package/dist/eventlog/EventRow.d.ts.map +1 -0
- package/dist/eventlog/EventRow.js +435 -0
- package/dist/eventlog/EventRow.js.map +1 -0
- package/dist/eventlog/SqlEventJournal.d.ts +18 -18
- package/dist/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/eventlog/SqlEventJournal.js +387 -159
- package/dist/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerEncrypted.d.ts +10 -18
- package/dist/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/eventlog/SqlEventLogServerEncrypted.js +179 -69
- package/dist/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts +23 -3
- package/dist/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/eventlog/SqlEventLogServerUnencrypted.js +102 -51
- package/dist/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/eventlog/index.d.ts +5 -0
- package/dist/eventlog/index.d.ts.map +1 -1
- package/dist/eventlog/index.js +5 -0
- package/dist/eventlog/index.js.map +1 -1
- package/dist/eventlog/internal/conflicts.d.ts +47 -0
- package/dist/eventlog/internal/conflicts.d.ts.map +1 -0
- package/dist/eventlog/internal/conflicts.js +92 -0
- package/dist/eventlog/internal/conflicts.js.map +1 -0
- package/dist/graphql/GraphQLClient.d.ts.map +1 -1
- package/dist/graphql/GraphQLClient.js +12 -5
- package/dist/graphql/GraphQLClient.js.map +1 -1
- package/dist/graphql/GraphQLClientError.d.ts +2 -2
- package/dist/graphql/GraphQLClientError.d.ts.map +1 -1
- package/dist/graphql/GraphQLClientError.js +4 -18
- package/dist/graphql/GraphQLClientError.js.map +1 -1
- package/dist/graphql/GraphQLProtocol.d.ts +252 -11
- package/dist/graphql/GraphQLProtocol.d.ts.map +1 -1
- package/dist/graphql/GraphQLProtocol.js +99 -8
- package/dist/graphql/GraphQLProtocol.js.map +1 -1
- package/dist/graphql/GraphQLResolver.d.ts +3 -1
- package/dist/graphql/GraphQLResolver.d.ts.map +1 -1
- package/dist/graphql/GraphQLResolver.js +91 -19
- package/dist/graphql/GraphQLResolver.js.map +1 -1
- package/dist/http/FetchHttpClient.d.ts +13 -3
- package/dist/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/http/FetchHttpClient.js +56 -6
- package/dist/http/FetchHttpClient.js.map +1 -1
- package/dist/http/FindMyWay/internal/router.js +12 -1
- package/dist/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/http/Headers.d.ts +230 -3
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +267 -5
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts +105 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +69 -17
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientError.d.ts.map +1 -1
- package/dist/http/HttpClientError.js +8 -6
- package/dist/http/HttpClientError.js.map +1 -1
- package/dist/http/HttpClientRequest.d.ts +274 -7
- package/dist/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/http/HttpClientRequest.js +91 -3
- package/dist/http/HttpClientRequest.js.map +1 -1
- package/dist/http/HttpClientResponse.d.ts +53 -0
- package/dist/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/http/HttpClientResponse.js +47 -0
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpEffect.d.ts +6 -2
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +21 -17
- package/dist/http/HttpEffect.js.map +1 -1
- package/dist/http/HttpIncomingMessage.d.ts +2 -1
- package/dist/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/http/HttpIncomingMessage.js +3 -23
- package/dist/http/HttpIncomingMessage.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts +179 -2
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +226 -18
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpRouter.d.ts.map +1 -1
- package/dist/http/HttpRouter.js +58 -14
- package/dist/http/HttpRouter.js.map +1 -1
- package/dist/http/HttpServerError.d.ts +5 -2
- package/dist/http/HttpServerError.d.ts.map +1 -1
- package/dist/http/HttpServerError.js +11 -7
- package/dist/http/HttpServerError.js.map +1 -1
- package/dist/http/HttpServerRequest.d.ts +25 -5
- package/dist/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/http/HttpServerRequest.js +38 -12
- package/dist/http/HttpServerRequest.js.map +1 -1
- package/dist/http/HttpServerResponse.d.ts +17 -8
- package/dist/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/http/HttpServerResponse.js +37 -21
- package/dist/http/HttpServerResponse.js.map +1 -1
- package/dist/http/HttpStaticServer.d.ts +0 -12
- package/dist/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/http/HttpStaticServer.js +25 -17
- package/dist/http/HttpStaticServer.js.map +1 -1
- package/dist/http/HttpTraceContext.js +1 -1
- package/dist/http/HttpTraceContext.js.map +1 -1
- package/dist/http/MultipartParser/internal/contentType.d.ts +15 -1
- package/dist/http/MultipartParser/internal/contentType.d.ts.map +1 -1
- package/dist/http/MultipartParser/internal/contentType.js +87 -5
- package/dist/http/MultipartParser/internal/contentType.js.map +1 -1
- package/dist/http/MultipartParser/internal/headers.d.ts.map +1 -1
- package/dist/http/MultipartParser/internal/headers.js +4 -12
- package/dist/http/MultipartParser/internal/headers.js.map +1 -1
- package/dist/http/MultipartParser/internal/multipart.d.ts.map +1 -1
- package/dist/http/MultipartParser/internal/multipart.js +6 -27
- package/dist/http/MultipartParser/internal/multipart.js.map +1 -1
- package/dist/http/Url.d.ts.map +1 -1
- package/dist/http/Url.js +8 -2
- package/dist/http/Url.js.map +1 -1
- package/dist/http/UrlParams.d.ts +112 -8
- package/dist/http/UrlParams.d.ts.map +1 -1
- package/dist/http/UrlParams.js +141 -14
- package/dist/http/UrlParams.js.map +1 -1
- package/dist/http/internal/compression.d.ts +1 -1
- package/dist/http/internal/compression.d.ts.map +1 -1
- package/dist/http/internal/compression.js +2 -10
- package/dist/http/internal/compression.js.map +1 -1
- package/dist/http/internal/compressionBody.d.ts +2 -0
- package/dist/http/internal/compressionBody.d.ts.map +1 -0
- package/dist/http/internal/compressionBody.js +36 -0
- package/dist/http/internal/compressionBody.js.map +1 -0
- package/dist/http/internal/decompression.d.ts +2 -0
- package/dist/http/internal/decompression.d.ts.map +1 -0
- package/dist/http/internal/decompression.js +168 -0
- package/dist/http/internal/decompression.js.map +1 -0
- package/dist/http/internal/lazyStream.d.ts +2 -0
- package/dist/http/internal/lazyStream.d.ts.map +1 -0
- package/dist/http/internal/lazyStream.js +18 -0
- package/dist/http/internal/lazyStream.js.map +1 -0
- package/dist/http/internal/requestState.d.ts +2 -0
- package/dist/http/internal/requestState.d.ts.map +1 -0
- package/dist/http/internal/requestState.js +28 -0
- package/dist/http/internal/requestState.js.map +1 -0
- package/dist/http/internal/tracing.js +14 -4
- package/dist/http/internal/tracing.js.map +1 -1
- package/dist/http/internal/urlParams.d.ts +2 -0
- package/dist/http/internal/urlParams.d.ts.map +1 -0
- package/dist/http/internal/urlParams.js +4 -0
- package/dist/http/internal/urlParams.js.map +1 -0
- package/dist/http/internal/webResponse.d.ts +2 -0
- package/dist/http/internal/webResponse.d.ts.map +1 -0
- package/dist/http/internal/webResponse.js +12 -0
- package/dist/http/internal/webResponse.js.map +1 -0
- package/dist/http-api/HttpApi.js +1 -1
- package/dist/http-api/HttpApi.js.map +1 -1
- package/dist/http-api/HttpApiBuilder.d.ts.map +1 -1
- package/dist/http-api/HttpApiBuilder.js +121 -18
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts +29 -4
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +85 -24
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiEndpoint.d.ts +55 -29
- package/dist/http-api/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/http-api/HttpApiEndpoint.js +49 -5
- package/dist/http-api/HttpApiEndpoint.js.map +1 -1
- package/dist/http-api/HttpApiError.d.ts +58 -0
- package/dist/http-api/HttpApiError.d.ts.map +1 -1
- package/dist/http-api/HttpApiError.js +38 -12
- package/dist/http-api/HttpApiError.js.map +1 -1
- package/dist/http-api/HttpApiScalar.d.ts +2 -1
- package/dist/http-api/HttpApiScalar.d.ts.map +1 -1
- package/dist/http-api/HttpApiScalar.js +6 -3
- package/dist/http-api/HttpApiScalar.js.map +1 -1
- package/dist/http-api/HttpApiSchema.d.ts +191 -9
- package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
- package/dist/http-api/HttpApiSchema.js +137 -4
- package/dist/http-api/HttpApiSchema.js.map +1 -1
- package/dist/http-api/HttpApiSwagger.d.ts +5 -0
- package/dist/http-api/HttpApiSwagger.d.ts.map +1 -1
- package/dist/http-api/HttpApiSwagger.js +14 -4
- package/dist/http-api/HttpApiSwagger.js.map +1 -1
- package/dist/http-api/HttpApiTest.d.ts +13 -2
- package/dist/http-api/HttpApiTest.d.ts.map +1 -1
- package/dist/http-api/HttpApiTest.js +30 -9
- package/dist/http-api/HttpApiTest.js.map +1 -1
- package/dist/http-api/OpenApi.d.ts +17 -3
- package/dist/http-api/OpenApi.d.ts.map +1 -1
- package/dist/http-api/OpenApi.js +57 -32
- package/dist/http-api/OpenApi.js.map +1 -1
- package/dist/http-api/internal/path.js +35 -10
- package/dist/http-api/internal/path.js.map +1 -1
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +18 -2
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +19 -7
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +89 -76
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/graphql.js +12 -2
- package/dist/internal/graphql.js.map +1 -1
- package/dist/internal/hashMap.js +2 -2
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/hydration.d.ts +2 -0
- package/dist/internal/hydration.d.ts.map +1 -0
- package/dist/internal/hydration.js +15 -0
- package/dist/internal/hydration.js.map +1 -0
- package/dist/internal/inflate.d.ts +2 -0
- package/dist/internal/inflate.d.ts.map +1 -0
- package/dist/internal/inflate.js +680 -0
- package/dist/internal/inflate.js.map +1 -0
- package/dist/internal/record.js +6 -0
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/request.js +20 -7
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schedule.js +17 -22
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +136 -126
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/interpreter.js +51 -36
- package/dist/internal/schema/interpreter.js.map +1 -1
- package/dist/internal/schema/standardSchema.js +34 -33
- package/dist/internal/schema/standardSchema.js.map +1 -1
- package/dist/internal/schema/toCodeDocument.js +7 -2
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toCodec.js +86 -1
- package/dist/internal/schema/toCodec.js.map +1 -1
- package/dist/internal/schema/toFormatter.js +5 -5
- package/dist/internal/schema/toFormatter.js.map +1 -1
- package/dist/internal/schema/toJsonSchemaDocument.js +60 -38
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/trie.js +1 -3
- package/dist/internal/trie.js.map +1 -1
- package/dist/internal/uuid.js +7 -3
- package/dist/internal/uuid.js.map +1 -1
- package/dist/internal/version.js +1 -1
- package/dist/net/NetAddress.d.ts.map +1 -1
- package/dist/net/NetAddress.js +2 -8
- package/dist/net/NetAddress.js.map +1 -1
- package/dist/observability/Otlp.d.ts +15 -0
- package/dist/observability/Otlp.d.ts.map +1 -1
- package/dist/observability/Otlp.js +3 -0
- package/dist/observability/Otlp.js.map +1 -1
- package/dist/observability/OtlpExporter.d.ts +8 -0
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +15 -13
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts +17 -0
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +14 -1
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts +17 -0
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +18 -3
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpResource.d.ts +3 -1
- package/dist/observability/OtlpResource.d.ts.map +1 -1
- package/dist/observability/OtlpResource.js +11 -4
- package/dist/observability/OtlpResource.js.map +1 -1
- package/dist/observability/OtlpSerialization.d.ts +5 -0
- package/dist/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/observability/OtlpSerialization.js +14 -3
- package/dist/observability/OtlpSerialization.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +17 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +15 -2
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/observability/internal/protobuf.d.ts +0 -9
- package/dist/observability/internal/protobuf.d.ts.map +1 -1
- package/dist/observability/internal/protobuf.js +2 -10
- package/dist/observability/internal/protobuf.js.map +1 -1
- package/dist/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/persistence/PersistedCache.js +1 -1
- package/dist/persistence/PersistedCache.js.map +1 -1
- package/dist/persistence/PersistedQueue.d.ts +6 -2
- package/dist/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/persistence/PersistedQueue.js +162 -84
- package/dist/persistence/PersistedQueue.js.map +1 -1
- package/dist/persistence/Persistence.d.ts +28 -0
- package/dist/persistence/Persistence.d.ts.map +1 -1
- package/dist/persistence/Persistence.js +36 -8
- package/dist/persistence/Persistence.js.map +1 -1
- package/dist/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/persistence/RateLimiter.js +8 -12
- package/dist/persistence/RateLimiter.js.map +1 -1
- package/dist/persistence/UserDirectories.d.ts +129 -0
- package/dist/persistence/UserDirectories.d.ts.map +1 -0
- package/dist/persistence/UserDirectories.js +178 -0
- package/dist/persistence/UserDirectories.js.map +1 -0
- package/dist/persistence/index.d.ts +5 -0
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +5 -0
- package/dist/persistence/index.js.map +1 -1
- package/dist/process/ChildProcess.d.ts +2 -1
- package/dist/process/ChildProcess.d.ts.map +1 -1
- package/dist/process/ChildProcess.js.map +1 -1
- package/dist/reactivity/AsyncResult.d.ts +6 -0
- package/dist/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/reactivity/AsyncResult.js +28 -1
- package/dist/reactivity/AsyncResult.js.map +1 -1
- package/dist/reactivity/Atom.d.ts +69 -30
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +40 -15
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomHttpApi.d.ts +5 -5
- package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/reactivity/AtomHttpApi.js +1 -1
- package/dist/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/reactivity/AtomRegistry.d.ts +2 -2
- package/dist/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/reactivity/AtomRegistry.js +47 -10
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/reactivity/AtomRpc.d.ts +3 -3
- package/dist/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/reactivity/AtomRpc.js +1 -1
- package/dist/reactivity/AtomRpc.js.map +1 -1
- package/dist/reactivity/Hydration.d.ts.map +1 -1
- package/dist/reactivity/Hydration.js +46 -12
- package/dist/reactivity/Hydration.js.map +1 -1
- package/dist/reactivity/Reactivity.d.ts +71 -7
- package/dist/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/reactivity/Reactivity.js +21 -12
- package/dist/reactivity/Reactivity.js.map +1 -1
- package/dist/rpc/Rpc.d.ts +18 -0
- package/dist/rpc/Rpc.d.ts.map +1 -1
- package/dist/rpc/Rpc.js +20 -0
- package/dist/rpc/Rpc.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +26 -2
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +202 -61
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcSerialization.d.ts +15 -0
- package/dist/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/rpc/RpcSerialization.js +21 -5
- package/dist/rpc/RpcSerialization.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +9 -18
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/schema/Model.d.ts +1 -1
- package/dist/schema/VariantSchema.d.ts +22 -3
- package/dist/schema/VariantSchema.d.ts.map +1 -1
- package/dist/schema/VariantSchema.js +32 -18
- package/dist/schema/VariantSchema.js.map +1 -1
- package/dist/socket/Socket.d.ts +23 -1
- package/dist/socket/Socket.d.ts.map +1 -1
- package/dist/socket/Socket.js +36 -3
- package/dist/socket/Socket.js.map +1 -1
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +15 -3
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlClient.d.ts +151 -12
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +156 -34
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/sql/SqlResolver.d.ts +9 -0
- package/dist/sql/SqlResolver.d.ts.map +1 -1
- package/dist/sql/SqlResolver.js +9 -0
- package/dist/sql/SqlResolver.js.map +1 -1
- package/dist/sql/Statement.d.ts +3 -1
- package/dist/sql/Statement.d.ts.map +1 -1
- package/dist/sql/Statement.js +24 -5
- package/dist/sql/Statement.js.map +1 -1
- package/dist/testing/TestClock.d.ts +16 -3
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +115 -23
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +7 -1
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +9 -3
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/workflow/Activity.js +1 -0
- package/dist/workflow/Activity.js.map +1 -1
- package/dist/workflow/Workflow.d.ts +22 -0
- package/dist/workflow/Workflow.d.ts.map +1 -1
- package/dist/workflow/Workflow.js +15 -3
- package/dist/workflow/Workflow.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts +20 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +52 -24
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +13 -3
- package/src/Array.ts +223 -61
- package/src/Bytes.ts +111 -0
- package/src/Channel.ts +287 -439
- package/src/ChannelSchema.ts +1 -49
- package/src/Chunk.ts +55 -61
- package/src/Config.ts +12 -86
- package/src/ConfigProvider.ts +41 -44
- package/src/Cron.ts +6 -3
- package/src/Duration.ts +70 -21
- package/src/Effect.ts +642 -220
- package/src/Equivalence.ts +7 -4
- package/src/Exit.ts +24 -9
- package/src/FiberHandle.ts +10 -9
- package/src/FiberMap.ts +13 -66
- package/src/FileSystem.ts +33 -9
- package/src/Graph.ts +171 -1263
- package/src/HashSet.ts +0 -60
- package/src/Iterable.ts +15 -14
- package/src/JsonSchema.ts +28 -3
- package/src/Layer.ts +2 -2
- package/src/ManagedRuntime.ts +72 -6
- package/src/Match.ts +65 -12
- package/src/Metric.ts +249 -507
- package/src/MutableHashMap.ts +4 -473
- package/src/Number.ts +2 -2
- package/src/Optic.ts +17 -332
- package/src/Path.ts +61 -8
- package/src/PubSub.ts +12 -7
- package/src/Queue.ts +5 -37
- package/src/Random.ts +1 -1
- package/src/RcMap.ts +14 -8
- package/src/Record.ts +51 -0
- package/src/Ref.ts +7 -104
- package/src/References.ts +5 -4
- package/src/RequestResolver.ts +46 -87
- package/src/Resource.ts +1 -1
- package/src/Runtime.ts +19 -18
- package/src/Schedule.ts +2 -94
- package/src/Schema.ts +596 -348
- package/src/SchemaAST.ts +20 -9
- package/src/SchemaGetter.ts +22 -5
- package/src/SchemaIssue.ts +44 -53
- package/src/SchemaRepresentation.ts +64 -1
- package/src/SchemaTransformation.ts +1 -1
- package/src/Scope.ts +12 -2
- package/src/ScopedCache.ts +17 -142
- package/src/SemVer.ts +1528 -0
- package/src/SemVerRange.ts +883 -0
- package/src/Sink.ts +6 -2
- package/src/Stream.ts +334 -1011
- package/src/String.ts +25 -12
- package/src/TextDiff.ts +766 -0
- package/src/TxHashMap.ts +1 -103
- package/src/TxHashSet.ts +48 -753
- package/src/TxRef.ts +4 -2
- package/src/ai/AiError.ts +69 -5
- package/src/ai/Chat.ts +10 -5
- package/src/ai/Decision.ts +119 -22
- package/src/ai/DecisionModel.ts +265 -109
- package/src/ai/EmbeddingModel.ts +25 -13
- package/src/ai/LanguageModel.ts +57 -51
- package/src/ai/McpClient.ts +1211 -0
- package/src/ai/McpClientError.ts +329 -0
- package/src/ai/McpProtocol.ts +2 -2
- package/src/ai/McpSchema.ts +153 -35
- package/src/ai/McpServer.ts +232 -275
- package/src/ai/Prompt.ts +49 -35
- package/src/ai/Response.ts +195 -65
- package/src/ai/Tool.ts +12 -4
- package/src/ai/Toolkit.ts +78 -10
- package/src/ai/index.ts +12 -0
- package/src/ai/internal/mcpCore.ts +13 -14
- package/src/ai/internal/mcpProtocol/v2024_11_05.ts +1 -1
- package/src/ai/internal/mcpProtocol/v2025_03_26.ts +1 -1
- package/src/ai/internal/mcpProtocol/v2025_06_18.ts +3 -3
- package/src/ai/internal/mcpProtocol/v2025_11_25.ts +3 -3
- package/src/ai/internal/mcpProtocol/v2026_07_28.ts +12 -14
- package/src/ai/internal/mcpProtocol.ts +22 -2
- package/src/ai/internal/mcpRuntime.ts +3 -4
- package/src/ai/internal/mcpSchema/v2024_11_05.ts +20 -13
- package/src/ai/internal/mcpSchema/v2025_03_26.ts +4 -2
- package/src/ai/internal/mcpSchema/v2025_06_18.ts +7 -7
- package/src/ai/internal/mcpSchema/v2025_11_25.ts +8 -8
- package/src/ai/internal/mcpSchema/v2026_07_28.ts +44 -42
- package/src/cli/CliError.ts +49 -4
- package/src/cli/Command.ts +316 -9
- package/src/cli/Completions.ts +10 -0
- package/src/cli/Flag.ts +218 -0
- package/src/cli/GlobalFlag.ts +3 -3
- package/src/cli/Param.ts +218 -0
- package/src/cli/TerminalCapabilities.ts +156 -0
- package/src/cli/index.ts +6 -0
- package/src/cli/internal/command.ts +10 -4
- package/src/cli/internal/completions/bash.ts +7 -5
- package/src/cli/internal/completions/descriptor.ts +20 -1
- package/src/cli/internal/completions/fish.ts +12 -10
- package/src/cli/internal/completions/powershell.ts +25 -13
- package/src/cli/internal/completions/zsh.ts +15 -8
- package/src/cli/internal/formatter.ts +18 -0
- package/src/cli/internal/lexer.ts +12 -5
- package/src/cli/internal/parser.ts +43 -14
- package/src/cli/internal/wizard.ts +2 -1
- package/src/cluster/ClusterCron.ts +94 -35
- package/src/cluster/ClusterMetrics.ts +149 -7
- package/src/cluster/ClusterWorkflowEngine.ts +164 -53
- package/src/cluster/Entity.ts +4 -0
- package/src/cluster/MessageStorage.ts +21 -3
- package/src/cluster/Runners.ts +145 -72
- package/src/cluster/Sharding.ts +118 -38
- package/src/cluster/ShardingConfig.ts +15 -0
- package/src/cluster/SqlMessageStorage.ts +58 -55
- package/src/cluster/SqlRunnerStorage.ts +10 -4
- package/src/cluster/internal/entityManager.ts +81 -11
- package/src/devtools/DevTools.ts +3 -2
- package/src/devtools/DevToolsClient.ts +27 -10
- package/src/encoding/Base64Url.ts +31 -0
- package/src/encoding/Ini.ts +3 -0
- package/src/encoding/JsonArray.ts +849 -0
- package/src/encoding/Ndjson.ts +211 -20
- package/src/encoding/SchemaBinary.ts +14 -48
- package/src/encoding/Sse.ts +1 -1
- package/src/encoding/Tar.ts +1417 -0
- package/src/encoding/Toml.ts +3 -3
- package/src/encoding/Xml.ts +2037 -0
- package/src/encoding/Yaml.ts +108 -36
- package/src/encoding/Zip.ts +1558 -0
- package/src/encoding/index.ts +24 -0
- package/src/eventlog/EventJournal.ts +611 -227
- package/src/eventlog/EventLog.ts +496 -196
- package/src/eventlog/EventLogEncryption.ts +128 -43
- package/src/eventlog/EventLogMessage.ts +62 -11
- package/src/eventlog/EventLogRemote.ts +77 -21
- package/src/eventlog/EventLogServer.ts +162 -20
- package/src/eventlog/EventLogServerEncrypted.ts +121 -80
- package/src/eventlog/EventLogServerUnencrypted.ts +180 -77
- package/src/eventlog/EventRow.ts +706 -0
- package/src/eventlog/SqlEventJournal.ts +453 -173
- package/src/eventlog/SqlEventLogServerEncrypted.ts +212 -83
- package/src/eventlog/SqlEventLogServerUnencrypted.ts +141 -62
- package/src/eventlog/index.ts +6 -0
- package/src/eventlog/internal/conflicts.ts +123 -0
- package/src/graphql/GraphQLClient.ts +17 -5
- package/src/graphql/GraphQLClientError.ts +5 -12
- package/src/graphql/GraphQLProtocol.ts +277 -20
- package/src/graphql/GraphQLResolver.ts +109 -230
- package/src/http/FetchHttpClient.ts +61 -8
- package/src/http/FindMyWay/internal/router.ts +13 -1
- package/src/http/Headers.ts +343 -163
- package/src/http/HttpClient.ts +144 -136
- package/src/http/HttpClientError.ts +10 -6
- package/src/http/HttpClientRequest.ts +315 -11
- package/src/http/HttpClientResponse.ts +71 -0
- package/src/http/HttpEffect.ts +25 -33
- package/src/http/HttpIncomingMessage.ts +3 -23
- package/src/http/HttpMiddleware.ts +265 -28
- package/src/http/HttpRouter.ts +67 -14
- package/src/http/HttpServerError.ts +14 -7
- package/src/http/HttpServerRequest.ts +73 -14
- package/src/http/HttpServerResponse.ts +49 -23
- package/src/http/HttpStaticServer.ts +29 -19
- package/src/http/HttpTraceContext.ts +1 -1
- package/src/http/MultipartParser/internal/contentType.ts +107 -6
- package/src/http/MultipartParser/internal/headers.ts +4 -16
- package/src/http/MultipartParser/internal/multipart.ts +10 -32
- package/src/http/Url.ts +8 -2
- package/src/http/UrlParams.ts +225 -26
- package/src/http/internal/compression.ts +3 -17
- package/src/http/internal/compressionBody.ts +56 -0
- package/src/http/internal/decompression.ts +235 -0
- package/src/http/internal/lazyStream.ts +25 -0
- package/src/http/internal/requestState.ts +33 -0
- package/src/http/internal/tracing.ts +21 -4
- package/src/http/internal/urlParams.ts +5 -0
- package/src/http/internal/webResponse.ts +20 -0
- package/src/http-api/HttpApi.ts +1 -1
- package/src/http-api/HttpApiBuilder.ts +151 -23
- package/src/http-api/HttpApiClient.ts +160 -31
- package/src/http-api/HttpApiEndpoint.ts +144 -33
- package/src/http-api/HttpApiError.ts +55 -0
- package/src/http-api/HttpApiScalar.ts +4 -3
- package/src/http-api/HttpApiSchema.ts +275 -13
- package/src/http-api/HttpApiSwagger.ts +11 -4
- package/src/http-api/HttpApiTest.ts +33 -9
- package/src/http-api/OpenApi.ts +84 -42
- package/src/http-api/internal/path.ts +40 -12
- package/src/index.ts +24 -0
- package/src/internal/core.ts +22 -2
- package/src/internal/dateTime.ts +20 -7
- package/src/internal/effect.ts +125 -88
- package/src/internal/graphql.ts +30 -7
- package/src/internal/hashMap.ts +2 -2
- package/src/internal/hydration.ts +15 -0
- package/src/internal/inflate.ts +710 -0
- package/src/internal/record.ts +6 -0
- package/src/internal/request.ts +21 -6
- package/src/internal/schedule.ts +20 -39
- package/src/internal/schema/fromJsonSchemaDocument.ts +262 -193
- package/src/internal/schema/interpreter.ts +58 -45
- package/src/internal/schema/standardSchema.ts +32 -30
- package/src/internal/schema/toCodeDocument.ts +8 -3
- package/src/internal/schema/toCodec.ts +116 -1
- package/src/internal/schema/toFormatter.ts +6 -6
- package/src/internal/schema/toJsonSchemaDocument.ts +69 -39
- package/src/internal/trie.ts +1 -3
- package/src/internal/uuid.ts +15 -10
- package/src/internal/version.ts +1 -1
- package/src/net/NetAddress.ts +2 -9
- package/src/observability/Otlp.ts +18 -0
- package/src/observability/OtlpExporter.ts +19 -15
- package/src/observability/OtlpLogger.ts +31 -2
- package/src/observability/OtlpMetrics.ts +35 -4
- package/src/observability/OtlpResource.ts +16 -6
- package/src/observability/OtlpSerialization.ts +17 -3
- package/src/observability/OtlpTracer.ts +32 -3
- package/src/observability/internal/protobuf.ts +2 -10
- package/src/persistence/PersistedCache.ts +3 -1
- package/src/persistence/PersistedQueue.ts +223 -153
- package/src/persistence/Persistence.ts +64 -30
- package/src/persistence/RateLimiter.ts +18 -21
- package/src/persistence/UserDirectories.ts +273 -0
- package/src/persistence/index.ts +6 -0
- package/src/process/ChildProcess.ts +2 -1
- package/src/reactivity/AsyncResult.ts +35 -38
- package/src/reactivity/Atom.ts +134 -166
- package/src/reactivity/AtomHttpApi.ts +10 -16
- package/src/reactivity/AtomRegistry.ts +53 -30
- package/src/reactivity/AtomRpc.ts +6 -22
- package/src/reactivity/Hydration.ts +53 -12
- package/src/reactivity/Reactivity.ts +97 -39
- package/src/rpc/Rpc.ts +21 -0
- package/src/rpc/RpcClient.ts +285 -104
- package/src/rpc/RpcSerialization.ts +21 -5
- package/src/rpc/RpcServer.ts +11 -20
- package/src/schema/VariantSchema.ts +86 -22
- package/src/socket/Socket.ts +45 -20
- package/src/sql/Migrator.ts +19 -9
- package/src/sql/SqlClient.ts +275 -36
- package/src/sql/SqlResolver.ts +9 -0
- package/src/sql/Statement.ts +35 -8
- package/src/testing/TestClock.ts +147 -29
- package/src/testing/TestSchema.ts +9 -3
- package/src/workflow/Activity.ts +1 -0
- package/src/workflow/Workflow.ts +31 -5
- package/src/workflow/WorkflowEngine.ts +93 -31
- package/dist/http/internal/preResponseHandler.d.ts +0 -2
- package/dist/http/internal/preResponseHandler.d.ts.map +0 -1
- package/dist/http/internal/preResponseHandler.js +0 -14
- package/dist/http/internal/preResponseHandler.js.map +0 -1
- package/src/http/internal/preResponseHandler.ts +0 -19
package/src/Stream.ts
CHANGED
|
@@ -823,8 +823,13 @@ export const sync = <A>(evaluate: LazyArg<A>): Stream<A> => fromChannel(Channel.
|
|
|
823
823
|
* @category constructors
|
|
824
824
|
* @since 2.0.0
|
|
825
825
|
*/
|
|
826
|
-
export const suspend = <A, E, R>(stream: LazyArg<Stream<A, E, R>>): Stream<A, E, R> =>
|
|
827
|
-
fromChannel(Channel.suspend(() => stream().channel))
|
|
826
|
+
export const suspend = <A, E, R>(stream: LazyArg<Stream<A, E, R>>): Stream<A, E, R> => {
|
|
827
|
+
const suspended = fromChannel(Channel.suspend(() => stream().channel))
|
|
828
|
+
suspendedStreams.set(suspended, stream)
|
|
829
|
+
return suspended
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
const suspendedStreams = new WeakMap<Stream<any, any, any>, LazyArg<Stream<any, any, any>>>()
|
|
828
833
|
|
|
829
834
|
/**
|
|
830
835
|
* Terminates with the specified error.
|
|
@@ -1259,9 +1264,10 @@ export const fromPubSubTake = <A, E>(pubsub: PubSub.PubSub<Take.Take<A, E>>): St
|
|
|
1259
1264
|
*
|
|
1260
1265
|
* **Details**
|
|
1261
1266
|
*
|
|
1262
|
-
* The stream reads from a `ReadableStreamDefaultReader
|
|
1263
|
-
* with `onError
|
|
1264
|
-
*
|
|
1267
|
+
* The stream reads from a `ReadableStreamDefaultReader` and maps read failures
|
|
1268
|
+
* with `onError`. Finalization cancels the reader and releases its lock, or
|
|
1269
|
+
* only releases the lock when `releaseLockOnEnd` is set. A rejected cancel
|
|
1270
|
+
* hook becomes a defect.
|
|
1265
1271
|
*
|
|
1266
1272
|
* **Example** (Creating a stream from a ReadableStream)
|
|
1267
1273
|
*
|
|
@@ -1433,6 +1439,11 @@ export interface EventListener<A = unknown> {
|
|
|
1433
1439
|
/**
|
|
1434
1440
|
* Creates a stream from an event listener.
|
|
1435
1441
|
*
|
|
1442
|
+
* **Gotchas**
|
|
1443
|
+
*
|
|
1444
|
+
* Event listeners cannot backpressure the source. When a bounded `bufferSize`
|
|
1445
|
+
* is full, additional events are dropped rather than suspending the listener.
|
|
1446
|
+
*
|
|
1436
1447
|
* **Example** (Creating a stream from an event listener)
|
|
1437
1448
|
*
|
|
1438
1449
|
* ```ts import.meta.vitest
|
|
@@ -1882,6 +1893,11 @@ export const as: {
|
|
|
1882
1893
|
/**
|
|
1883
1894
|
* Maps both the failure and success channels of a stream.
|
|
1884
1895
|
*
|
|
1896
|
+
* **Details**
|
|
1897
|
+
*
|
|
1898
|
+
* Maps every typed error in the cause, preserving defects, interrupts and
|
|
1899
|
+
* reason order. Unlike typed recovery, mapping does not convert errors to defects.
|
|
1900
|
+
*
|
|
1885
1901
|
* **Example** (Mapping both the failure and success channels of a stream)
|
|
1886
1902
|
*
|
|
1887
1903
|
* ```ts import.meta.vitest
|
|
@@ -1918,6 +1934,11 @@ export const mapBoth: {
|
|
|
1918
1934
|
/**
|
|
1919
1935
|
* Maps both the failure and success channels of a stream.
|
|
1920
1936
|
*
|
|
1937
|
+
* **Details**
|
|
1938
|
+
*
|
|
1939
|
+
* Maps every typed error in the cause, preserving defects, interrupts and
|
|
1940
|
+
* reason order. Unlike typed recovery, mapping does not convert errors to defects.
|
|
1941
|
+
*
|
|
1921
1942
|
* **Example** (Mapping both the failure and success channels of a stream)
|
|
1922
1943
|
*
|
|
1923
1944
|
* ```ts import.meta.vitest
|
|
@@ -1956,6 +1977,11 @@ export const mapBoth: {
|
|
|
1956
1977
|
/**
|
|
1957
1978
|
* Maps both the failure and success channels of a stream.
|
|
1958
1979
|
*
|
|
1980
|
+
* **Details**
|
|
1981
|
+
*
|
|
1982
|
+
* Maps every typed error in the cause, preserving defects, interrupts and
|
|
1983
|
+
* reason order. Unlike typed recovery, mapping does not convert errors to defects.
|
|
1984
|
+
*
|
|
1959
1985
|
* **Example** (Mapping both the failure and success channels of a stream)
|
|
1960
1986
|
*
|
|
1961
1987
|
* ```ts import.meta.vitest
|
|
@@ -3924,70 +3950,7 @@ export const concat: {
|
|
|
3924
3950
|
2,
|
|
3925
3951
|
<A, E, R, A2, E2, R2>(self: Stream<A, E, R>, that: Stream<A2, E2, R2>): Stream<A | A2, E | E2, R | R2> => {
|
|
3926
3952
|
const stream = fromChannel(
|
|
3927
|
-
Channel.flatten(Channel.fromIterator(() => concatChannels
|
|
3928
|
-
* Concatenates two streams, emitting all elements from the first stream
|
|
3929
|
-
* followed by all elements from the second stream.
|
|
3930
|
-
*
|
|
3931
|
-
* **Example** (Concatenating streams)
|
|
3932
|
-
*
|
|
3933
|
-
* ```ts import.meta.vitest
|
|
3934
|
-
* import { Effect, Stream } from "effect"
|
|
3935
|
-
*
|
|
3936
|
-
* const stream = Stream.concat(Stream.make(1, 2, 3), Stream.make(4, 5, 6))
|
|
3937
|
-
*
|
|
3938
|
-
* await Effect.runPromise(Effect.gen(function*() {
|
|
3939
|
-
* const values = yield* Stream.runCollect(stream)
|
|
3940
|
-
* values // => [ 1, 2, 3, 4, 5, 6 ]
|
|
3941
|
-
* }))
|
|
3942
|
-
* ```
|
|
3943
|
-
*
|
|
3944
|
-
* @stability stable
|
|
3945
|
-
* @category sequencing
|
|
3946
|
-
* @since 2.0.0
|
|
3947
|
-
*/
|
|
3948
|
-
A | A2, /**
|
|
3949
|
-
* Concatenates two streams, emitting all elements from the first stream
|
|
3950
|
-
* followed by all elements from the second stream.
|
|
3951
|
-
*
|
|
3952
|
-
* **Example** (Concatenating streams)
|
|
3953
|
-
*
|
|
3954
|
-
* ```ts import.meta.vitest
|
|
3955
|
-
* import { Effect, Stream } from "effect"
|
|
3956
|
-
*
|
|
3957
|
-
* const stream = Stream.concat(Stream.make(1, 2, 3), Stream.make(4, 5, 6))
|
|
3958
|
-
*
|
|
3959
|
-
* await Effect.runPromise(Effect.gen(function*() {
|
|
3960
|
-
* const values = yield* Stream.runCollect(stream)
|
|
3961
|
-
* values // => [ 1, 2, 3, 4, 5, 6 ]
|
|
3962
|
-
* }))
|
|
3963
|
-
* ```
|
|
3964
|
-
*
|
|
3965
|
-
* @stability stable
|
|
3966
|
-
* @category sequencing
|
|
3967
|
-
* @since 2.0.0
|
|
3968
|
-
*/
|
|
3969
|
-
E | E2, /**
|
|
3970
|
-
* Concatenates two streams, emitting all elements from the first stream
|
|
3971
|
-
* followed by all elements from the second stream.
|
|
3972
|
-
*
|
|
3973
|
-
* **Example** (Concatenating streams)
|
|
3974
|
-
*
|
|
3975
|
-
* ```ts import.meta.vitest
|
|
3976
|
-
* import { Effect, Stream } from "effect"
|
|
3977
|
-
*
|
|
3978
|
-
* const stream = Stream.concat(Stream.make(1, 2, 3), Stream.make(4, 5, 6))
|
|
3979
|
-
*
|
|
3980
|
-
* await Effect.runPromise(Effect.gen(function*() {
|
|
3981
|
-
* const values = yield* Stream.runCollect(stream)
|
|
3982
|
-
* values // => [ 1, 2, 3, 4, 5, 6 ]
|
|
3983
|
-
* }))
|
|
3984
|
-
* ```
|
|
3985
|
-
*
|
|
3986
|
-
* @stability stable
|
|
3987
|
-
* @category sequencing
|
|
3988
|
-
* @since 2.0.0
|
|
3989
|
-
*/
|
|
3990
|
-
R | R2>(self, that)))
|
|
3953
|
+
Channel.flatten(Channel.fromIterator(() => concatChannels<A | A2, E | E2, R | R2>(self, that)))
|
|
3991
3954
|
)
|
|
3992
3955
|
concatParts.set(stream, [self, that])
|
|
3993
3956
|
return stream
|
|
@@ -3998,14 +3961,30 @@ export const concat: {
|
|
|
3998
3961
|
// a single layer instead of one layer per call
|
|
3999
3962
|
const concatParts = new WeakMap<Stream<any, any, any>, readonly [Stream<any, any, any>, Stream<any, any, any>]>()
|
|
4000
3963
|
|
|
4001
|
-
// Yields the channel of each non-`concat` stream in a chain, in order
|
|
3964
|
+
// Yields the channel of each non-`concat` stream in a chain, in order. A
|
|
3965
|
+
// `suspend` part is evaluated when it is reached and its result joins the chain
|
|
4002
3966
|
function* concatChannels<A, E, R>(self: Stream<A, E, R>, that: Stream<A, E, R>) {
|
|
4003
3967
|
const stack = [that, self]
|
|
4004
3968
|
while (stack.length > 0) {
|
|
4005
3969
|
const stream = stack.pop()!
|
|
4006
3970
|
const parts = concatParts.get(stream)
|
|
4007
|
-
if (parts
|
|
4008
|
-
|
|
3971
|
+
if (parts !== undefined) {
|
|
3972
|
+
stack.push(parts[1], parts[0])
|
|
3973
|
+
continue
|
|
3974
|
+
}
|
|
3975
|
+
const evaluate = suspendedStreams.get(stream)
|
|
3976
|
+
if (evaluate === undefined) {
|
|
3977
|
+
yield stream.channel
|
|
3978
|
+
continue
|
|
3979
|
+
}
|
|
3980
|
+
// Evaluated here rather than in an effect, so retrying an interrupted pull
|
|
3981
|
+
// cannot evaluate it twice. `Channel.empty` keeps a yield point
|
|
3982
|
+
try {
|
|
3983
|
+
stack.push(evaluate())
|
|
3984
|
+
} catch (defect) {
|
|
3985
|
+
stack.push(die(defect))
|
|
3986
|
+
}
|
|
3987
|
+
yield Channel.empty
|
|
4009
3988
|
}
|
|
4010
3989
|
}
|
|
4011
3990
|
|
|
@@ -5104,24 +5083,23 @@ export const zipWith: {
|
|
|
5104
5083
|
left: Stream<AL, EL, RL>,
|
|
5105
5084
|
right: Stream<AR, ER, RR>,
|
|
5106
5085
|
f: (left: AL, right: AR) => A
|
|
5107
|
-
): Stream<A, EL | ER, RL | RR> =>
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
(
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
}
|
|
5086
|
+
): Stream<A, EL | ER, RL | RR> =>
|
|
5087
|
+
suspend(() => {
|
|
5088
|
+
// Track consumed elements with cursors instead of slicing leftovers
|
|
5089
|
+
let leftIndex = 0
|
|
5090
|
+
let rightIndex = 0
|
|
5091
|
+
return zipWithArray(left, right, (leftArr, rightArr) => {
|
|
5092
|
+
const length = Math.min(leftArr.length - leftIndex, rightArr.length - rightIndex)
|
|
5093
|
+
const output = Arr.makeBy(length, (i) => f(leftArr[leftIndex + i], rightArr[rightIndex + i]))
|
|
5094
|
+
leftIndex += length
|
|
5095
|
+
rightIndex += length
|
|
5096
|
+
const leftDone = leftIndex === leftArr.length
|
|
5097
|
+
const rightDone = rightIndex === rightArr.length
|
|
5098
|
+
if (leftDone) leftIndex = 0
|
|
5099
|
+
if (rightDone) rightIndex = 0
|
|
5100
|
+
return [output, leftDone ? [] : leftArr, rightDone ? [] : rightArr]
|
|
5101
|
+
})
|
|
5102
|
+
}))
|
|
5125
5103
|
|
|
5126
5104
|
/**
|
|
5127
5105
|
* Zips two streams by applying a function to non-empty arrays of elements.
|
|
@@ -5273,31 +5251,23 @@ export const zipWithArray: {
|
|
|
5273
5251
|
]
|
|
5274
5252
|
})
|
|
5275
5253
|
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
| { _tag: "PullLeft"; rightArray: Arr.NonEmptyReadonlyArray<AR> }
|
|
5279
|
-
| { _tag: "PullRight"; leftArray: Arr.NonEmptyReadonlyArray<AL> }
|
|
5280
|
-
let state: State = { _tag: "PullBoth" }
|
|
5254
|
+
let leftArray: Arr.NonEmptyReadonlyArray<AL> | undefined
|
|
5255
|
+
let rightArray: Arr.NonEmptyReadonlyArray<AR> | undefined
|
|
5281
5256
|
|
|
5282
5257
|
const pull: Effect.Effect<
|
|
5283
5258
|
Arr.NonEmptyReadonlyArray<A>,
|
|
5284
5259
|
EL | ER | Cause.Done,
|
|
5285
5260
|
RL | RR
|
|
5286
5261
|
> = Effect.gen(function*() {
|
|
5287
|
-
const [left, right] =
|
|
5288
|
-
? yield*
|
|
5289
|
-
:
|
|
5290
|
-
? [yield* pullLeft,
|
|
5291
|
-
:
|
|
5292
|
-
const
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
state = { _tag: "PullLeft", rightArray: result[2] }
|
|
5297
|
-
} else {
|
|
5298
|
-
state = { _tag: "PullBoth" }
|
|
5299
|
-
}
|
|
5300
|
-
return result[0]
|
|
5262
|
+
const [left, right] = leftArray
|
|
5263
|
+
? [leftArray, rightArray ?? (yield* pullRight)]
|
|
5264
|
+
: rightArray
|
|
5265
|
+
? [yield* pullLeft, rightArray]
|
|
5266
|
+
: yield* pullBoth
|
|
5267
|
+
const [output, leftoverLeft, leftoverRight] = f(left, right)
|
|
5268
|
+
leftArray = Arr.isReadonlyArrayNonEmpty(leftoverLeft) ? leftoverLeft : undefined
|
|
5269
|
+
rightArray = Arr.isReadonlyArrayNonEmpty(leftoverRight) ? leftoverRight : undefined
|
|
5270
|
+
return output
|
|
5301
5271
|
})
|
|
5302
5272
|
|
|
5303
5273
|
return pull
|
|
@@ -5484,15 +5454,7 @@ export const zipLeft: {
|
|
|
5484
5454
|
<AL, EL, RL, AR, ER, RR>(
|
|
5485
5455
|
left: Stream<AL, EL, RL>,
|
|
5486
5456
|
right: Stream<AR, ER, RR>
|
|
5487
|
-
): Stream<AL, EL | ER, RL | RR> =>
|
|
5488
|
-
zipWithArray(left, right, (leftArr, rightArr) => {
|
|
5489
|
-
const minLength = Math.min(leftArr.length, rightArr.length)
|
|
5490
|
-
const output = leftArr.slice(0, minLength) as Arr.NonEmptyArray<AL>
|
|
5491
|
-
const leftoverLeft = leftArr.slice(minLength)
|
|
5492
|
-
const leftoverRight = rightArr.slice(minLength)
|
|
5493
|
-
|
|
5494
|
-
return [output, leftoverLeft, leftoverRight] as const
|
|
5495
|
-
})
|
|
5457
|
+
): Stream<AL, EL | ER, RL | RR> => zipWith(left, right, (a) => a)
|
|
5496
5458
|
)
|
|
5497
5459
|
|
|
5498
5460
|
/**
|
|
@@ -5572,15 +5534,7 @@ export const zipRight: {
|
|
|
5572
5534
|
<AL, EL, RL, AR, ER, RR>(
|
|
5573
5535
|
left: Stream<AL, EL, RL>,
|
|
5574
5536
|
right: Stream<AR, ER, RR>
|
|
5575
|
-
): Stream<AR, EL | ER, RL | RR> =>
|
|
5576
|
-
zipWithArray(left, right, (leftArr, rightArr) => {
|
|
5577
|
-
const minLength = Math.min(leftArr.length, rightArr.length)
|
|
5578
|
-
const output = rightArr.slice(0, minLength) as Arr.NonEmptyArray<AR>
|
|
5579
|
-
const leftoverLeft = leftArr.slice(minLength)
|
|
5580
|
-
const leftoverRight = rightArr.slice(minLength)
|
|
5581
|
-
|
|
5582
|
-
return [output, leftoverLeft, leftoverRight] as const
|
|
5583
|
-
})
|
|
5537
|
+
): Stream<AR, EL | ER, RL | RR> => zipWith(left, right, (_, a) => a)
|
|
5584
5538
|
)
|
|
5585
5539
|
|
|
5586
5540
|
/**
|
|
@@ -6832,144 +6786,8 @@ export const partitionQueue: {
|
|
|
6832
6786
|
const scope = yield* Effect.scope
|
|
6833
6787
|
const pull = yield* Channel.toPullScoped(self.channel, scope)
|
|
6834
6788
|
const capacity = options?.capacity === "unbounded" ? undefined : options?.capacity ?? DefaultChunkSize
|
|
6835
|
-
const passes = yield* Queue.make
|
|
6836
|
-
|
|
6837
|
-
* as scoped queues.
|
|
6838
|
-
*
|
|
6839
|
-
* **Details**
|
|
6840
|
-
*
|
|
6841
|
-
* The queues are backed by a fiber in the current scope and should be consumed
|
|
6842
|
-
* while that scope remains open. Each queue fails with the stream error or
|
|
6843
|
-
* `Cause.Done` when the source ends.
|
|
6844
|
-
*
|
|
6845
|
-
* **Example** (Partitioning a stream into queues)
|
|
6846
|
-
*
|
|
6847
|
-
* ```ts import.meta.vitest
|
|
6848
|
-
* import { Effect, Result, Stream } from "effect"
|
|
6849
|
-
*
|
|
6850
|
-
* const program = Effect.gen(function*() {
|
|
6851
|
-
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
6852
|
-
* Stream.partitionQueue((n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
6853
|
-
* )
|
|
6854
|
-
*
|
|
6855
|
-
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
6856
|
-
* const failValues = yield* Stream.fromQueue(fails).pipe(Stream.runCollect)
|
|
6857
|
-
*
|
|
6858
|
-
* passValues // => [ 2, 4 ]
|
|
6859
|
-
* failValues // => [ 1, 3 ]
|
|
6860
|
-
* })
|
|
6861
|
-
*
|
|
6862
|
-
* await Effect.runPromise(Effect.scoped(program))
|
|
6863
|
-
* ```
|
|
6864
|
-
*
|
|
6865
|
-
* @stability stable
|
|
6866
|
-
* @category filtering
|
|
6867
|
-
* @since 4.0.0
|
|
6868
|
-
*/
|
|
6869
|
-
Pass, /**
|
|
6870
|
-
* Partitions a stream using a `Filter` and exposes passing and failing values
|
|
6871
|
-
* as scoped queues.
|
|
6872
|
-
*
|
|
6873
|
-
* **Details**
|
|
6874
|
-
*
|
|
6875
|
-
* The queues are backed by a fiber in the current scope and should be consumed
|
|
6876
|
-
* while that scope remains open. Each queue fails with the stream error or
|
|
6877
|
-
* `Cause.Done` when the source ends.
|
|
6878
|
-
*
|
|
6879
|
-
* **Example** (Partitioning a stream into queues)
|
|
6880
|
-
*
|
|
6881
|
-
* ```ts import.meta.vitest
|
|
6882
|
-
* import { Effect, Result, Stream } from "effect"
|
|
6883
|
-
*
|
|
6884
|
-
* const program = Effect.gen(function*() {
|
|
6885
|
-
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
6886
|
-
* Stream.partitionQueue((n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
6887
|
-
* )
|
|
6888
|
-
*
|
|
6889
|
-
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
6890
|
-
* const failValues = yield* Stream.fromQueue(fails).pipe(Stream.runCollect)
|
|
6891
|
-
*
|
|
6892
|
-
* passValues // => [ 2, 4 ]
|
|
6893
|
-
* failValues // => [ 1, 3 ]
|
|
6894
|
-
* })
|
|
6895
|
-
*
|
|
6896
|
-
* await Effect.runPromise(Effect.scoped(program))
|
|
6897
|
-
* ```
|
|
6898
|
-
*
|
|
6899
|
-
* @stability stable
|
|
6900
|
-
* @category filtering
|
|
6901
|
-
* @since 4.0.0
|
|
6902
|
-
*/
|
|
6903
|
-
E | Cause.Done>({ capacity })
|
|
6904
|
-
const fails = yield* Queue.make</**
|
|
6905
|
-
* Partitions a stream using a `Filter` and exposes passing and failing values
|
|
6906
|
-
* as scoped queues.
|
|
6907
|
-
*
|
|
6908
|
-
* **Details**
|
|
6909
|
-
*
|
|
6910
|
-
* The queues are backed by a fiber in the current scope and should be consumed
|
|
6911
|
-
* while that scope remains open. Each queue fails with the stream error or
|
|
6912
|
-
* `Cause.Done` when the source ends.
|
|
6913
|
-
*
|
|
6914
|
-
* **Example** (Partitioning a stream into queues)
|
|
6915
|
-
*
|
|
6916
|
-
* ```ts import.meta.vitest
|
|
6917
|
-
* import { Effect, Result, Stream } from "effect"
|
|
6918
|
-
*
|
|
6919
|
-
* const program = Effect.gen(function*() {
|
|
6920
|
-
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
6921
|
-
* Stream.partitionQueue((n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
6922
|
-
* )
|
|
6923
|
-
*
|
|
6924
|
-
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
6925
|
-
* const failValues = yield* Stream.fromQueue(fails).pipe(Stream.runCollect)
|
|
6926
|
-
*
|
|
6927
|
-
* passValues // => [ 2, 4 ]
|
|
6928
|
-
* failValues // => [ 1, 3 ]
|
|
6929
|
-
* })
|
|
6930
|
-
*
|
|
6931
|
-
* await Effect.runPromise(Effect.scoped(program))
|
|
6932
|
-
* ```
|
|
6933
|
-
*
|
|
6934
|
-
* @stability stable
|
|
6935
|
-
* @category filtering
|
|
6936
|
-
* @since 4.0.0
|
|
6937
|
-
*/
|
|
6938
|
-
Fail, /**
|
|
6939
|
-
* Partitions a stream using a `Filter` and exposes passing and failing values
|
|
6940
|
-
* as scoped queues.
|
|
6941
|
-
*
|
|
6942
|
-
* **Details**
|
|
6943
|
-
*
|
|
6944
|
-
* The queues are backed by a fiber in the current scope and should be consumed
|
|
6945
|
-
* while that scope remains open. Each queue fails with the stream error or
|
|
6946
|
-
* `Cause.Done` when the source ends.
|
|
6947
|
-
*
|
|
6948
|
-
* **Example** (Partitioning a stream into queues)
|
|
6949
|
-
*
|
|
6950
|
-
* ```ts import.meta.vitest
|
|
6951
|
-
* import { Effect, Result, Stream } from "effect"
|
|
6952
|
-
*
|
|
6953
|
-
* const program = Effect.gen(function*() {
|
|
6954
|
-
* const [passes, fails] = yield* Stream.make(1, 2, 3, 4).pipe(
|
|
6955
|
-
* Stream.partitionQueue((n) => n % 2 === 0 ? Result.succeed(n) : Result.fail(n))
|
|
6956
|
-
* )
|
|
6957
|
-
*
|
|
6958
|
-
* const passValues = yield* Stream.fromQueue(passes).pipe(Stream.runCollect)
|
|
6959
|
-
* const failValues = yield* Stream.fromQueue(fails).pipe(Stream.runCollect)
|
|
6960
|
-
*
|
|
6961
|
-
* passValues // => [ 2, 4 ]
|
|
6962
|
-
* failValues // => [ 1, 3 ]
|
|
6963
|
-
* })
|
|
6964
|
-
*
|
|
6965
|
-
* await Effect.runPromise(Effect.scoped(program))
|
|
6966
|
-
* ```
|
|
6967
|
-
*
|
|
6968
|
-
* @stability stable
|
|
6969
|
-
* @category filtering
|
|
6970
|
-
* @since 4.0.0
|
|
6971
|
-
*/
|
|
6972
|
-
E | Cause.Done>({ capacity })
|
|
6789
|
+
const passes = yield* Queue.make<Pass, E | Cause.Done>({ capacity })
|
|
6790
|
+
const fails = yield* Queue.make<Fail, E | Cause.Done>({ capacity })
|
|
6973
6791
|
|
|
6974
6792
|
yield* Effect.gen(function*() {
|
|
6975
6793
|
while (true) {
|
|
@@ -7138,122 +6956,7 @@ export const partitionEffect: {
|
|
|
7138
6956
|
R | RX | Scope.Scope
|
|
7139
6957
|
> =>
|
|
7140
6958
|
Effect.map(
|
|
7141
|
-
partitionQueue
|
|
7142
|
-
* Splits a stream with an effectful `Filter`, returning scoped streams for
|
|
7143
|
-
* filter successes and failures.
|
|
7144
|
-
*
|
|
7145
|
-
* **When to use**
|
|
7146
|
-
*
|
|
7147
|
-
* Use when you need to classify each stream element with an effectful `Filter`
|
|
7148
|
-
* and consume both passing and failing mapped values as streams.
|
|
7149
|
-
*
|
|
7150
|
-
* **Details**
|
|
7151
|
-
*
|
|
7152
|
-
* The returned streams are backed by queues in the current scope and should be
|
|
7153
|
-
* consumed while that scope remains open. The first stream emits success values
|
|
7154
|
-
* from the filter, and the second emits failure values.
|
|
7155
|
-
*
|
|
7156
|
-
* @see {@link partition} for the pure `Filter` variant
|
|
7157
|
-
* @see {@link partitionQueue} for the lower-level queue result
|
|
7158
|
-
* @see {@link filterMapEffect} for effectful filtering that discards failed filter results
|
|
7159
|
-
*
|
|
7160
|
-
* @stability stable
|
|
7161
|
-
* @category filtering
|
|
7162
|
-
* @since 4.0.0
|
|
7163
|
-
*/
|
|
7164
|
-
Result.Result<Pass, Fail>, /**
|
|
7165
|
-
* Splits a stream with an effectful `Filter`, returning scoped streams for
|
|
7166
|
-
* filter successes and failures.
|
|
7167
|
-
*
|
|
7168
|
-
* **When to use**
|
|
7169
|
-
*
|
|
7170
|
-
* Use when you need to classify each stream element with an effectful `Filter`
|
|
7171
|
-
* and consume both passing and failing mapped values as streams.
|
|
7172
|
-
*
|
|
7173
|
-
* **Details**
|
|
7174
|
-
*
|
|
7175
|
-
* The returned streams are backed by queues in the current scope and should be
|
|
7176
|
-
* consumed while that scope remains open. The first stream emits success values
|
|
7177
|
-
* from the filter, and the second emits failure values.
|
|
7178
|
-
*
|
|
7179
|
-
* @see {@link partition} for the pure `Filter` variant
|
|
7180
|
-
* @see {@link partitionQueue} for the lower-level queue result
|
|
7181
|
-
* @see {@link filterMapEffect} for effectful filtering that discards failed filter results
|
|
7182
|
-
*
|
|
7183
|
-
* @stability stable
|
|
7184
|
-
* @category filtering
|
|
7185
|
-
* @since 4.0.0
|
|
7186
|
-
*/
|
|
7187
|
-
E | EX, /**
|
|
7188
|
-
* Splits a stream with an effectful `Filter`, returning scoped streams for
|
|
7189
|
-
* filter successes and failures.
|
|
7190
|
-
*
|
|
7191
|
-
* **When to use**
|
|
7192
|
-
*
|
|
7193
|
-
* Use when you need to classify each stream element with an effectful `Filter`
|
|
7194
|
-
* and consume both passing and failing mapped values as streams.
|
|
7195
|
-
*
|
|
7196
|
-
* **Details**
|
|
7197
|
-
*
|
|
7198
|
-
* The returned streams are backed by queues in the current scope and should be
|
|
7199
|
-
* consumed while that scope remains open. The first stream emits success values
|
|
7200
|
-
* from the filter, and the second emits failure values.
|
|
7201
|
-
*
|
|
7202
|
-
* @see {@link partition} for the pure `Filter` variant
|
|
7203
|
-
* @see {@link partitionQueue} for the lower-level queue result
|
|
7204
|
-
* @see {@link filterMapEffect} for effectful filtering that discards failed filter results
|
|
7205
|
-
*
|
|
7206
|
-
* @stability stable
|
|
7207
|
-
* @category filtering
|
|
7208
|
-
* @since 4.0.0
|
|
7209
|
-
*/
|
|
7210
|
-
R | RX, /**
|
|
7211
|
-
* Splits a stream with an effectful `Filter`, returning scoped streams for
|
|
7212
|
-
* filter successes and failures.
|
|
7213
|
-
*
|
|
7214
|
-
* **When to use**
|
|
7215
|
-
*
|
|
7216
|
-
* Use when you need to classify each stream element with an effectful `Filter`
|
|
7217
|
-
* and consume both passing and failing mapped values as streams.
|
|
7218
|
-
*
|
|
7219
|
-
* **Details**
|
|
7220
|
-
*
|
|
7221
|
-
* The returned streams are backed by queues in the current scope and should be
|
|
7222
|
-
* consumed while that scope remains open. The first stream emits success values
|
|
7223
|
-
* from the filter, and the second emits failure values.
|
|
7224
|
-
*
|
|
7225
|
-
* @see {@link partition} for the pure `Filter` variant
|
|
7226
|
-
* @see {@link partitionQueue} for the lower-level queue result
|
|
7227
|
-
* @see {@link filterMapEffect} for effectful filtering that discards failed filter results
|
|
7228
|
-
*
|
|
7229
|
-
* @stability stable
|
|
7230
|
-
* @category filtering
|
|
7231
|
-
* @since 4.0.0
|
|
7232
|
-
*/
|
|
7233
|
-
Pass, /**
|
|
7234
|
-
* Splits a stream with an effectful `Filter`, returning scoped streams for
|
|
7235
|
-
* filter successes and failures.
|
|
7236
|
-
*
|
|
7237
|
-
* **When to use**
|
|
7238
|
-
*
|
|
7239
|
-
* Use when you need to classify each stream element with an effectful `Filter`
|
|
7240
|
-
* and consume both passing and failing mapped values as streams.
|
|
7241
|
-
*
|
|
7242
|
-
* **Details**
|
|
7243
|
-
*
|
|
7244
|
-
* The returned streams are backed by queues in the current scope and should be
|
|
7245
|
-
* consumed while that scope remains open. The first stream emits success values
|
|
7246
|
-
* from the filter, and the second emits failure values.
|
|
7247
|
-
*
|
|
7248
|
-
* @see {@link partition} for the pure `Filter` variant
|
|
7249
|
-
* @see {@link partitionQueue} for the lower-level queue result
|
|
7250
|
-
* @see {@link filterMapEffect} for effectful filtering that discards failed filter results
|
|
7251
|
-
*
|
|
7252
|
-
* @stability stable
|
|
7253
|
-
* @category filtering
|
|
7254
|
-
* @since 4.0.0
|
|
7255
|
-
*/
|
|
7256
|
-
Fail>(
|
|
6959
|
+
partitionQueue<Result.Result<Pass, Fail>, E | EX, R | RX, Pass, Fail>(
|
|
7257
6960
|
mapEffect(self, (a) => filter(a as NoInfer<A>), options),
|
|
7258
6961
|
(result) => result,
|
|
7259
6962
|
options
|
|
@@ -7953,6 +7656,12 @@ export const catchCause: {
|
|
|
7953
7656
|
*
|
|
7954
7657
|
* Typed failures and interruptions are not caught.
|
|
7955
7658
|
*
|
|
7659
|
+
* **Gotchas**
|
|
7660
|
+
*
|
|
7661
|
+
* `catchDefect` recovers any cause that contains a defect, including causes
|
|
7662
|
+
* that also contain typed errors. Typed error handlers such as `catch` skip
|
|
7663
|
+
* those causes, so defects always take precedence.
|
|
7664
|
+
*
|
|
7956
7665
|
* **Example** (Recovering from a defect)
|
|
7957
7666
|
*
|
|
7958
7667
|
* ```ts import.meta.vitest
|
|
@@ -7978,6 +7687,12 @@ export const catchDefect: {
|
|
|
7978
7687
|
*
|
|
7979
7688
|
* Typed failures and interruptions are not caught.
|
|
7980
7689
|
*
|
|
7690
|
+
* **Gotchas**
|
|
7691
|
+
*
|
|
7692
|
+
* `catchDefect` recovers any cause that contains a defect, including causes
|
|
7693
|
+
* that also contain typed errors. Typed error handlers such as `catch` skip
|
|
7694
|
+
* those causes, so defects always take precedence.
|
|
7695
|
+
*
|
|
7981
7696
|
* **Example** (Recovering from a defect)
|
|
7982
7697
|
*
|
|
7983
7698
|
* ```ts import.meta.vitest
|
|
@@ -8003,6 +7718,12 @@ export const catchDefect: {
|
|
|
8003
7718
|
*
|
|
8004
7719
|
* Typed failures and interruptions are not caught.
|
|
8005
7720
|
*
|
|
7721
|
+
* **Gotchas**
|
|
7722
|
+
*
|
|
7723
|
+
* `catchDefect` recovers any cause that contains a defect, including causes
|
|
7724
|
+
* that also contain typed errors. Typed error handlers such as `catch` skip
|
|
7725
|
+
* those causes, so defects always take precedence.
|
|
7726
|
+
*
|
|
8006
7727
|
* **Example** (Recovering from a defect)
|
|
8007
7728
|
*
|
|
8008
7729
|
* ```ts import.meta.vitest
|
|
@@ -8149,6 +7870,13 @@ export {
|
|
|
8149
7870
|
/**
|
|
8150
7871
|
* Switches over to the stream produced by the provided function if this one fails.
|
|
8151
7872
|
*
|
|
7873
|
+
* **Gotchas**
|
|
7874
|
+
*
|
|
7875
|
+
* Defects take precedence over typed errors. If the cause also contains a
|
|
7876
|
+
* defect, the handler does not run and the failure is propagated with every
|
|
7877
|
+
* typed error converted to a defect. An interruption alongside a typed error
|
|
7878
|
+
* does not prevent recovery.
|
|
7879
|
+
*
|
|
8152
7880
|
* **Example** (Catching stream failures)
|
|
8153
7881
|
*
|
|
8154
7882
|
* ```ts import.meta.vitest
|
|
@@ -8553,6 +8281,12 @@ export const tapDefect: {
|
|
|
8553
8281
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
8554
8282
|
* preserved unless the filter narrows it.
|
|
8555
8283
|
*
|
|
8284
|
+
* **Gotchas**
|
|
8285
|
+
*
|
|
8286
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8287
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8288
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8289
|
+
*
|
|
8556
8290
|
* **Example** (Catching matching failures)
|
|
8557
8291
|
*
|
|
8558
8292
|
* ```ts import.meta.vitest
|
|
@@ -8588,6 +8322,12 @@ export const catchIf: {
|
|
|
8588
8322
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
8589
8323
|
* preserved unless the filter narrows it.
|
|
8590
8324
|
*
|
|
8325
|
+
* **Gotchas**
|
|
8326
|
+
*
|
|
8327
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8328
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8329
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8330
|
+
*
|
|
8591
8331
|
* **Example** (Catching matching failures)
|
|
8592
8332
|
*
|
|
8593
8333
|
* ```ts import.meta.vitest
|
|
@@ -8629,6 +8369,12 @@ export const catchIf: {
|
|
|
8629
8369
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
8630
8370
|
* preserved unless the filter narrows it.
|
|
8631
8371
|
*
|
|
8372
|
+
* **Gotchas**
|
|
8373
|
+
*
|
|
8374
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8375
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8376
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8377
|
+
*
|
|
8632
8378
|
* **Example** (Catching matching failures)
|
|
8633
8379
|
*
|
|
8634
8380
|
* ```ts import.meta.vitest
|
|
@@ -8670,6 +8416,12 @@ export const catchIf: {
|
|
|
8670
8416
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
8671
8417
|
* preserved unless the filter narrows it.
|
|
8672
8418
|
*
|
|
8419
|
+
* **Gotchas**
|
|
8420
|
+
*
|
|
8421
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8422
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8423
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8424
|
+
*
|
|
8673
8425
|
* **Example** (Catching matching failures)
|
|
8674
8426
|
*
|
|
8675
8427
|
* ```ts import.meta.vitest
|
|
@@ -8697,7 +8449,7 @@ export const catchIf: {
|
|
|
8697
8449
|
*/
|
|
8698
8450
|
<A, E, R, EB extends E, A2, E2, R2, A3 = unassigned, E3 = never, R3 = never>(
|
|
8699
8451
|
self: Stream<A, E, R>,
|
|
8700
|
-
refinement: Refinement<E
|
|
8452
|
+
refinement: Refinement<NoInfer<E>, EB>,
|
|
8701
8453
|
f: (e: EB) => Stream<A2, E2, R2>,
|
|
8702
8454
|
orElse?: ((e: Exclude<E, EB>) => Stream<A3, E3, R3>) | undefined
|
|
8703
8455
|
): Stream<A | A2 | Exclude<A3, unassigned>, E2 | E3 | (A3 extends unassigned ? Exclude<E, EB> : never), R | R2 | R3>
|
|
@@ -8710,6 +8462,12 @@ export const catchIf: {
|
|
|
8710
8462
|
* stream. Non-matching failures propagate downstream, so the error type is
|
|
8711
8463
|
* preserved unless the filter narrows it.
|
|
8712
8464
|
*
|
|
8465
|
+
* **Gotchas**
|
|
8466
|
+
*
|
|
8467
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8468
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8469
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8470
|
+
*
|
|
8713
8471
|
* **Example** (Catching matching failures)
|
|
8714
8472
|
*
|
|
8715
8473
|
* ```ts import.meta.vitest
|
|
@@ -8780,6 +8538,12 @@ export const catchIf: {
|
|
|
8780
8538
|
* Successful filter results are passed to `f`. Failed filter results go to
|
|
8781
8539
|
* `orElse` when provided; otherwise the filter failure is re-failed.
|
|
8782
8540
|
*
|
|
8541
|
+
* **Gotchas**
|
|
8542
|
+
*
|
|
8543
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8544
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8545
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8546
|
+
*
|
|
8783
8547
|
* @see {@link catchIf} for predicate or refinement based recovery
|
|
8784
8548
|
* @see {@link catchTag} for `_tag` based recovery from one tagged error
|
|
8785
8549
|
* @see {@link catchTags} for `_tag` based recovery from multiple tagged errors
|
|
@@ -8804,6 +8568,12 @@ export const catchFilter: {
|
|
|
8804
8568
|
* Successful filter results are passed to `f`. Failed filter results go to
|
|
8805
8569
|
* `orElse` when provided; otherwise the filter failure is re-failed.
|
|
8806
8570
|
*
|
|
8571
|
+
* **Gotchas**
|
|
8572
|
+
*
|
|
8573
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8574
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8575
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8576
|
+
*
|
|
8807
8577
|
* @see {@link catchIf} for predicate or refinement based recovery
|
|
8808
8578
|
* @see {@link catchTag} for `_tag` based recovery from one tagged error
|
|
8809
8579
|
* @see {@link catchTags} for `_tag` based recovery from multiple tagged errors
|
|
@@ -8834,6 +8604,12 @@ export const catchFilter: {
|
|
|
8834
8604
|
* Successful filter results are passed to `f`. Failed filter results go to
|
|
8835
8605
|
* `orElse` when provided; otherwise the filter failure is re-failed.
|
|
8836
8606
|
*
|
|
8607
|
+
* **Gotchas**
|
|
8608
|
+
*
|
|
8609
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8610
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8611
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8612
|
+
*
|
|
8837
8613
|
* @see {@link catchIf} for predicate or refinement based recovery
|
|
8838
8614
|
* @see {@link catchTag} for `_tag` based recovery from one tagged error
|
|
8839
8615
|
* @see {@link catchTags} for `_tag` based recovery from multiple tagged errors
|
|
@@ -8885,6 +8661,12 @@ export const catchFilter: {
|
|
|
8885
8661
|
* Use when you need to handle a specific error case from a stream whose error
|
|
8886
8662
|
* type is a tagged union with a readonly `_tag` field.
|
|
8887
8663
|
*
|
|
8664
|
+
* **Gotchas**
|
|
8665
|
+
*
|
|
8666
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8667
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8668
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8669
|
+
*
|
|
8888
8670
|
* **Example** (Catching tagged failures)
|
|
8889
8671
|
*
|
|
8890
8672
|
* ```ts import.meta.vitest
|
|
@@ -8920,6 +8702,12 @@ export const catchTag: {
|
|
|
8920
8702
|
* Use when you need to handle a specific error case from a stream whose error
|
|
8921
8703
|
* type is a tagged union with a readonly `_tag` field.
|
|
8922
8704
|
*
|
|
8705
|
+
* **Gotchas**
|
|
8706
|
+
*
|
|
8707
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8708
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8709
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8710
|
+
*
|
|
8923
8711
|
* **Example** (Catching tagged failures)
|
|
8924
8712
|
*
|
|
8925
8713
|
* ```ts import.meta.vitest
|
|
@@ -8980,6 +8768,12 @@ export const catchTag: {
|
|
|
8980
8768
|
* Use when you need to handle a specific error case from a stream whose error
|
|
8981
8769
|
* type is a tagged union with a readonly `_tag` field.
|
|
8982
8770
|
*
|
|
8771
|
+
* **Gotchas**
|
|
8772
|
+
*
|
|
8773
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8774
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8775
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8776
|
+
*
|
|
8983
8777
|
* **Example** (Catching tagged failures)
|
|
8984
8778
|
*
|
|
8985
8779
|
* ```ts import.meta.vitest
|
|
@@ -9061,6 +8855,12 @@ export const catchTag: {
|
|
|
9061
8855
|
/**
|
|
9062
8856
|
* Switches to a recovery stream based on matching `_tag` handlers.
|
|
9063
8857
|
*
|
|
8858
|
+
* **Gotchas**
|
|
8859
|
+
*
|
|
8860
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8861
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8862
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8863
|
+
*
|
|
9064
8864
|
* **Example** (Catching tagged failures with handlers)
|
|
9065
8865
|
*
|
|
9066
8866
|
* ```ts import.meta.vitest
|
|
@@ -9100,6 +8900,12 @@ export const catchTags: {
|
|
|
9100
8900
|
/**
|
|
9101
8901
|
* Switches to a recovery stream based on matching `_tag` handlers.
|
|
9102
8902
|
*
|
|
8903
|
+
* **Gotchas**
|
|
8904
|
+
*
|
|
8905
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8906
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8907
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8908
|
+
*
|
|
9103
8909
|
* **Example** (Catching tagged failures with handlers)
|
|
9104
8910
|
*
|
|
9105
8911
|
* ```ts import.meta.vitest
|
|
@@ -9166,6 +8972,12 @@ export const catchTags: {
|
|
|
9166
8972
|
/**
|
|
9167
8973
|
* Switches to a recovery stream based on matching `_tag` handlers.
|
|
9168
8974
|
*
|
|
8975
|
+
* **Gotchas**
|
|
8976
|
+
*
|
|
8977
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
8978
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
8979
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
8980
|
+
*
|
|
9169
8981
|
* **Example** (Catching tagged failures with handlers)
|
|
9170
8982
|
*
|
|
9171
8983
|
* ```ts import.meta.vitest
|
|
@@ -9259,6 +9071,12 @@ export const catchTags: {
|
|
|
9259
9071
|
*
|
|
9260
9072
|
* The handler receives the unwrapped reason.
|
|
9261
9073
|
*
|
|
9074
|
+
* **Gotchas**
|
|
9075
|
+
*
|
|
9076
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
9077
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
9078
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
9079
|
+
*
|
|
9262
9080
|
* **Example** (Catching a tagged error reason)
|
|
9263
9081
|
*
|
|
9264
9082
|
* ```ts import.meta.vitest
|
|
@@ -9310,6 +9128,12 @@ export const catchReason: {
|
|
|
9310
9128
|
*
|
|
9311
9129
|
* The handler receives the unwrapped reason.
|
|
9312
9130
|
*
|
|
9131
|
+
* **Gotchas**
|
|
9132
|
+
*
|
|
9133
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
9134
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
9135
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
9136
|
+
*
|
|
9313
9137
|
* **Example** (Catching a tagged error reason)
|
|
9314
9138
|
*
|
|
9315
9139
|
* ```ts import.meta.vitest
|
|
@@ -9390,6 +9214,12 @@ export const catchReason: {
|
|
|
9390
9214
|
*
|
|
9391
9215
|
* The handler receives the unwrapped reason.
|
|
9392
9216
|
*
|
|
9217
|
+
* **Gotchas**
|
|
9218
|
+
*
|
|
9219
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
9220
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
9221
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
9222
|
+
*
|
|
9393
9223
|
* **Example** (Catching a tagged error reason)
|
|
9394
9224
|
*
|
|
9395
9225
|
* ```ts import.meta.vitest
|
|
@@ -9494,6 +9324,12 @@ export const catchReason: {
|
|
|
9494
9324
|
/**
|
|
9495
9325
|
* Catches multiple reasons within a tagged error using an object of handlers.
|
|
9496
9326
|
*
|
|
9327
|
+
* **Gotchas**
|
|
9328
|
+
*
|
|
9329
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
9330
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
9331
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
9332
|
+
*
|
|
9497
9333
|
* **Example** (Catching tagged error reasons)
|
|
9498
9334
|
*
|
|
9499
9335
|
* ```ts import.meta.vitest
|
|
@@ -9537,6 +9373,12 @@ export const catchReasons: {
|
|
|
9537
9373
|
/**
|
|
9538
9374
|
* Catches multiple reasons within a tagged error using an object of handlers.
|
|
9539
9375
|
*
|
|
9376
|
+
* **Gotchas**
|
|
9377
|
+
*
|
|
9378
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
9379
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
9380
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
9381
|
+
*
|
|
9540
9382
|
* **Example** (Catching tagged error reasons)
|
|
9541
9383
|
*
|
|
9542
9384
|
* ```ts import.meta.vitest
|
|
@@ -9618,6 +9460,12 @@ export const catchReasons: {
|
|
|
9618
9460
|
/**
|
|
9619
9461
|
* Catches multiple reasons within a tagged error using an object of handlers.
|
|
9620
9462
|
*
|
|
9463
|
+
* **Gotchas**
|
|
9464
|
+
*
|
|
9465
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
9466
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
9467
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
9468
|
+
*
|
|
9621
9469
|
* **Example** (Catching tagged error reasons)
|
|
9622
9470
|
*
|
|
9623
9471
|
* ```ts import.meta.vitest
|
|
@@ -9889,6 +9737,11 @@ export const unwrapReason: {
|
|
|
9889
9737
|
/**
|
|
9890
9738
|
* Transforms the errors emitted by this stream using `f`.
|
|
9891
9739
|
*
|
|
9740
|
+
* **Details**
|
|
9741
|
+
*
|
|
9742
|
+
* Maps every typed error in the cause, preserving defects, interrupts and
|
|
9743
|
+
* reason order. Unlike typed recovery, mapping does not convert errors to defects.
|
|
9744
|
+
*
|
|
9892
9745
|
* **Example** (Mapping stream errors)
|
|
9893
9746
|
*
|
|
9894
9747
|
* ```ts import.meta.vitest
|
|
@@ -9914,6 +9767,11 @@ export const mapError: {
|
|
|
9914
9767
|
/**
|
|
9915
9768
|
* Transforms the errors emitted by this stream using `f`.
|
|
9916
9769
|
*
|
|
9770
|
+
* **Details**
|
|
9771
|
+
*
|
|
9772
|
+
* Maps every typed error in the cause, preserving defects, interrupts and
|
|
9773
|
+
* reason order. Unlike typed recovery, mapping does not convert errors to defects.
|
|
9774
|
+
*
|
|
9917
9775
|
* **Example** (Mapping stream errors)
|
|
9918
9776
|
*
|
|
9919
9777
|
* ```ts import.meta.vitest
|
|
@@ -9939,6 +9797,11 @@ export const mapError: {
|
|
|
9939
9797
|
/**
|
|
9940
9798
|
* Transforms the errors emitted by this stream using `f`.
|
|
9941
9799
|
*
|
|
9800
|
+
* **Details**
|
|
9801
|
+
*
|
|
9802
|
+
* Maps every typed error in the cause, preserving defects, interrupts and
|
|
9803
|
+
* reason order. Unlike typed recovery, mapping does not convert errors to defects.
|
|
9804
|
+
*
|
|
9942
9805
|
* **Example** (Mapping stream errors)
|
|
9943
9806
|
*
|
|
9944
9807
|
* ```ts import.meta.vitest
|
|
@@ -10256,6 +10119,12 @@ export const orElseIfEmpty: {
|
|
|
10256
10119
|
/**
|
|
10257
10120
|
* Returns a stream that emits a fallback value when this stream fails.
|
|
10258
10121
|
*
|
|
10122
|
+
* **Gotchas**
|
|
10123
|
+
*
|
|
10124
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
10125
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
10126
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
10127
|
+
*
|
|
10259
10128
|
* **Example** (Recovering with a fallback value)
|
|
10260
10129
|
*
|
|
10261
10130
|
* ```ts import.meta.vitest
|
|
@@ -10281,6 +10150,12 @@ export const orElseSucceed: {
|
|
|
10281
10150
|
/**
|
|
10282
10151
|
* Returns a stream that emits a fallback value when this stream fails.
|
|
10283
10152
|
*
|
|
10153
|
+
* **Gotchas**
|
|
10154
|
+
*
|
|
10155
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
10156
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
10157
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
10158
|
+
*
|
|
10284
10159
|
* **Example** (Recovering with a fallback value)
|
|
10285
10160
|
*
|
|
10286
10161
|
* ```ts import.meta.vitest
|
|
@@ -10306,6 +10181,12 @@ export const orElseSucceed: {
|
|
|
10306
10181
|
/**
|
|
10307
10182
|
* Returns a stream that emits a fallback value when this stream fails.
|
|
10308
10183
|
*
|
|
10184
|
+
* **Gotchas**
|
|
10185
|
+
*
|
|
10186
|
+
* If the cause contains a defect, the handler is skipped and every typed error
|
|
10187
|
+
* is converted to a defect, preserving reason order and interrupts. An
|
|
10188
|
+
* interruption alongside a typed error does not prevent recovery.
|
|
10189
|
+
*
|
|
10309
10190
|
* **Example** (Recovering with a fallback value)
|
|
10310
10191
|
*
|
|
10311
10192
|
* ```ts import.meta.vitest
|
|
@@ -10372,6 +10253,13 @@ export const orDie = <A, E, R>(self: Stream<A, E, R>): Stream<A, never, R> => fr
|
|
|
10372
10253
|
* The `log` option controls whether the failure is logged before the stream
|
|
10373
10254
|
* terminates.
|
|
10374
10255
|
*
|
|
10256
|
+
* **Gotchas**
|
|
10257
|
+
*
|
|
10258
|
+
* Defects take precedence over typed errors. If the cause also contains a
|
|
10259
|
+
* defect, the failure is not ignored and is propagated with every typed error
|
|
10260
|
+
* converted to a defect. An interruption alongside a typed error does not
|
|
10261
|
+
* prevent the error from being ignored.
|
|
10262
|
+
*
|
|
10375
10263
|
* **Example** (Ignoring stream failures)
|
|
10376
10264
|
*
|
|
10377
10265
|
* ```ts import.meta.vitest
|
|
@@ -10489,6 +10377,12 @@ export const ignoreCause: <
|
|
|
10489
10377
|
* The schedule is reset as soon as the first element passes through the
|
|
10490
10378
|
* stream again.
|
|
10491
10379
|
*
|
|
10380
|
+
* **Gotchas**
|
|
10381
|
+
*
|
|
10382
|
+
* Defects take precedence over typed errors. A failure whose cause contains a
|
|
10383
|
+
* defect is not retried and is propagated with every typed error converted to a
|
|
10384
|
+
* defect. A typed error alongside an interruption is retried.
|
|
10385
|
+
*
|
|
10492
10386
|
* **Example** (Retrying stream failures)
|
|
10493
10387
|
*
|
|
10494
10388
|
* ```ts import.meta.vitest
|
|
@@ -10524,6 +10418,12 @@ export const retry: {
|
|
|
10524
10418
|
* The schedule is reset as soon as the first element passes through the
|
|
10525
10419
|
* stream again.
|
|
10526
10420
|
*
|
|
10421
|
+
* **Gotchas**
|
|
10422
|
+
*
|
|
10423
|
+
* Defects take precedence over typed errors. A failure whose cause contains a
|
|
10424
|
+
* defect is not retried and is propagated with every typed error converted to a
|
|
10425
|
+
* defect. A typed error alongside an interruption is retried.
|
|
10426
|
+
*
|
|
10527
10427
|
* **Example** (Retrying stream failures)
|
|
10528
10428
|
*
|
|
10529
10429
|
* ```ts import.meta.vitest
|
|
@@ -10565,6 +10465,12 @@ export const retry: {
|
|
|
10565
10465
|
* The schedule is reset as soon as the first element passes through the
|
|
10566
10466
|
* stream again.
|
|
10567
10467
|
*
|
|
10468
|
+
* **Gotchas**
|
|
10469
|
+
*
|
|
10470
|
+
* Defects take precedence over typed errors. A failure whose cause contains a
|
|
10471
|
+
* defect is not retried and is propagated with every typed error converted to a
|
|
10472
|
+
* defect. A typed error alongside an interruption is retried.
|
|
10473
|
+
*
|
|
10568
10474
|
* **Example** (Retrying stream failures)
|
|
10569
10475
|
*
|
|
10570
10476
|
* ```ts import.meta.vitest
|
|
@@ -10847,57 +10753,7 @@ export const withExecutionPlan: {
|
|
|
10847
10753
|
return emitter.end(state, exit)
|
|
10848
10754
|
})
|
|
10849
10755
|
)
|
|
10850
|
-
let lastError = Option.none
|
|
10851
|
-
* Applies an `ExecutionPlan` to a stream, retrying with step-provided resources
|
|
10852
|
-
* until it succeeds or the plan is exhausted.
|
|
10853
|
-
*
|
|
10854
|
-
* **Details**
|
|
10855
|
-
*
|
|
10856
|
-
* By default, a failing step can fallback even after emitting elements; set
|
|
10857
|
-
* `preventFallbackOnPartialStream` to fail instead of mixing partial output with
|
|
10858
|
-
* a later fallback.
|
|
10859
|
-
*
|
|
10860
|
-
* Attempts can be observed from outside the stream by passing
|
|
10861
|
-
* `options.onEvent`, which receives an `ExecutionPlan.Event` before each
|
|
10862
|
-
* attempt and after it settles; see `Effect.withExecutionPlan` for the handler
|
|
10863
|
-
* semantics. When a downstream consumer stops pulling early (for example
|
|
10864
|
-
* `Stream.take` outside the plan), the truncated attempt reports
|
|
10865
|
-
* `AttemptSuccess`: the consumer stopped, not the source.
|
|
10866
|
-
*
|
|
10867
|
-
* **Example** (Applying an execution plan)
|
|
10868
|
-
*
|
|
10869
|
-
* ```ts import.meta.vitest
|
|
10870
|
-
* import { Context, Effect, ExecutionPlan, Layer, Stream } from "effect"
|
|
10871
|
-
*
|
|
10872
|
-
* class Service extends Context.Service<Service>()("Service", {
|
|
10873
|
-
* make: Effect.succeed({
|
|
10874
|
-
* stream: Stream.fail("A") as Stream.Stream<number, string>
|
|
10875
|
-
* })
|
|
10876
|
-
* }) {
|
|
10877
|
-
* static Bad = Layer.succeed(Service, Service.of({ stream: Stream.fail("A") }))
|
|
10878
|
-
* static Good = Layer.succeed(Service, Service.of({ stream: Stream.make(1, 2, 3) }))
|
|
10879
|
-
* }
|
|
10880
|
-
*
|
|
10881
|
-
* const plan = ExecutionPlan.make(
|
|
10882
|
-
* { provide: Service.Bad },
|
|
10883
|
-
* { provide: Service.Good }
|
|
10884
|
-
* )
|
|
10885
|
-
*
|
|
10886
|
-
* const stream = Stream.unwrap(Effect.map(Service, (_) => _.stream))
|
|
10887
|
-
*
|
|
10888
|
-
* const program = Effect.gen(function*() {
|
|
10889
|
-
* const items = yield* stream.pipe(Stream.withExecutionPlan(plan), Stream.runCollect)
|
|
10890
|
-
* items // => [ 1, 2, 3 ]
|
|
10891
|
-
* })
|
|
10892
|
-
*
|
|
10893
|
-
* await Effect.runPromise(program)
|
|
10894
|
-
* ```
|
|
10895
|
-
*
|
|
10896
|
-
* @stability unstable
|
|
10897
|
-
* @category error handling
|
|
10898
|
-
* @since 3.16.0
|
|
10899
|
-
*/
|
|
10900
|
-
E | PolicyE>()
|
|
10756
|
+
let lastError = Option.none<E | PolicyE>()
|
|
10901
10757
|
const loop: Stream<
|
|
10902
10758
|
A,
|
|
10903
10759
|
E | PolicyE,
|
|
@@ -12533,36 +12389,7 @@ export const dropRight: {
|
|
|
12533
12389
|
if (count === 0) return self
|
|
12534
12390
|
return transformPull(self, (pull, _scope) =>
|
|
12535
12391
|
Effect.sync(() => {
|
|
12536
|
-
const list = MutableList.make
|
|
12537
|
-
* Drops the last specified number of elements from this stream.
|
|
12538
|
-
*
|
|
12539
|
-
* **Details**
|
|
12540
|
-
*
|
|
12541
|
-
* Keeps the last `n` elements in memory to drop them on completion. Finite
|
|
12542
|
-
* fractional values of `n` are rounded down. `NaN` and non-positive values
|
|
12543
|
-
* return the source stream unchanged.
|
|
12544
|
-
*
|
|
12545
|
-
* **Example** (Dropping values from the right)
|
|
12546
|
-
*
|
|
12547
|
-
* ```ts import.meta.vitest
|
|
12548
|
-
* import { Effect, Stream } from "effect"
|
|
12549
|
-
*
|
|
12550
|
-
* const program = Effect.gen(function*() {
|
|
12551
|
-
* const result = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
12552
|
-
* Stream.dropRight(2),
|
|
12553
|
-
* Stream.runCollect
|
|
12554
|
-
* )
|
|
12555
|
-
* result // => [ 1, 2, 3 ]
|
|
12556
|
-
* })
|
|
12557
|
-
*
|
|
12558
|
-
* await Effect.runPromise(program)
|
|
12559
|
-
* ```
|
|
12560
|
-
*
|
|
12561
|
-
* @stability stable
|
|
12562
|
-
* @category filtering
|
|
12563
|
-
* @since 2.0.0
|
|
12564
|
-
*/
|
|
12565
|
-
A>()
|
|
12392
|
+
const list = MutableList.make<A>()
|
|
12566
12393
|
const emit: Pull.Pull<Arr.NonEmptyReadonlyArray<A>, E> = Effect.flatMap(pull, (arr) => {
|
|
12567
12394
|
MutableList.appendAllUnsafe(list, arr)
|
|
12568
12395
|
const toTake = list.length - count
|
|
@@ -12570,7 +12397,7 @@ export const dropRight: {
|
|
|
12570
12397
|
return Arr.isArrayNonEmpty(items) ? Effect.succeed(items) : emit
|
|
12571
12398
|
})
|
|
12572
12399
|
return emit
|
|
12573
|
-
}))
|
|
12400
|
+
}))
|
|
12574
12401
|
}
|
|
12575
12402
|
)
|
|
12576
12403
|
|
|
@@ -12698,36 +12525,7 @@ export const rechunk: {
|
|
|
12698
12525
|
target = Count.normalizeNonEmpty(target)
|
|
12699
12526
|
return transformPull(self, (pull, _scope) =>
|
|
12700
12527
|
Effect.sync(() => {
|
|
12701
|
-
let chunk = Arr.empty
|
|
12702
|
-
* Groups the stream into arrays of the specified size, preserving element order.
|
|
12703
|
-
*
|
|
12704
|
-
* **Details**
|
|
12705
|
-
*
|
|
12706
|
-
* Finite fractional sizes are rounded down. `NaN` and non-positive sizes are
|
|
12707
|
-
* treated as `1`.
|
|
12708
|
-
*
|
|
12709
|
-
* **Example** (Rechunking stream elements)
|
|
12710
|
-
*
|
|
12711
|
-
* ```ts import.meta.vitest
|
|
12712
|
-
* import { Effect, Stream } from "effect"
|
|
12713
|
-
*
|
|
12714
|
-
* const program = Effect.gen(function*() {
|
|
12715
|
-
* const result = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
12716
|
-
* Stream.rechunk(2),
|
|
12717
|
-
* Stream.chunks,
|
|
12718
|
-
* Stream.runCollect
|
|
12719
|
-
* )
|
|
12720
|
-
* result // => [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ]
|
|
12721
|
-
* })
|
|
12722
|
-
*
|
|
12723
|
-
* await Effect.runPromise(program)
|
|
12724
|
-
* ```
|
|
12725
|
-
*
|
|
12726
|
-
* @stability stable
|
|
12727
|
-
* @category grouping
|
|
12728
|
-
* @since 2.0.0
|
|
12729
|
-
*/
|
|
12730
|
-
A>() as Arr.NonEmptyArray<A>
|
|
12528
|
+
let chunk = Arr.empty<A>() as Arr.NonEmptyArray<A>
|
|
12731
12529
|
let index = 0
|
|
12732
12530
|
let current: Arr.NonEmptyReadonlyArray<A> | undefined
|
|
12733
12531
|
let done = false
|
|
@@ -12768,7 +12566,7 @@ export const rechunk: {
|
|
|
12768
12566
|
return Effect.succeed(result)
|
|
12769
12567
|
})
|
|
12770
12568
|
)
|
|
12771
|
-
}))
|
|
12569
|
+
}))
|
|
12772
12570
|
})
|
|
12773
12571
|
|
|
12774
12572
|
/**
|
|
@@ -12956,35 +12754,7 @@ export const slidingSize: {
|
|
|
12956
12754
|
return transformPull(self, (upstream, _scope) =>
|
|
12957
12755
|
Effect.sync(() => {
|
|
12958
12756
|
let cause: Cause.Cause<E | Cause.Done> | null = null
|
|
12959
|
-
const list = MutableList.make
|
|
12960
|
-
* Emits sliding windows of `chunkSize` elements, advancing by `stepSize`.
|
|
12961
|
-
*
|
|
12962
|
-
* **Details**
|
|
12963
|
-
*
|
|
12964
|
-
* Finite fractional window and step sizes are rounded down. `NaN` and
|
|
12965
|
-
* non-positive sizes are treated as `1`.
|
|
12966
|
-
*
|
|
12967
|
-
* **Example** (Emitting sliding windows with a step size)
|
|
12968
|
-
*
|
|
12969
|
-
* ```ts import.meta.vitest
|
|
12970
|
-
* import { Effect, Stream } from "effect"
|
|
12971
|
-
*
|
|
12972
|
-
* const program = Effect.gen(function*() {
|
|
12973
|
-
* const chunks = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
12974
|
-
* Stream.slidingSize(3, 2),
|
|
12975
|
-
* Stream.runCollect
|
|
12976
|
-
* )
|
|
12977
|
-
* chunks // => [ [ 1, 2, 3 ], [ 3, 4, 5 ] ]
|
|
12978
|
-
* })
|
|
12979
|
-
*
|
|
12980
|
-
* await Effect.runPromise(program)
|
|
12981
|
-
* ```
|
|
12982
|
-
*
|
|
12983
|
-
* @stability stable
|
|
12984
|
-
* @category grouping
|
|
12985
|
-
* @since 2.0.0
|
|
12986
|
-
*/
|
|
12987
|
-
A>()
|
|
12757
|
+
const list = MutableList.make<A>()
|
|
12988
12758
|
let emitted = false
|
|
12989
12759
|
let skip = 0
|
|
12990
12760
|
const pull: Pull.Pull<
|
|
@@ -13022,7 +12792,7 @@ export const slidingSize: {
|
|
|
13022
12792
|
})
|
|
13023
12793
|
|
|
13024
12794
|
return Effect.suspend(() => cause ? Effect.failCause(cause) : pull)
|
|
13025
|
-
}))
|
|
12795
|
+
}))
|
|
13026
12796
|
}
|
|
13027
12797
|
)
|
|
13028
12798
|
|
|
@@ -13171,34 +12941,7 @@ export const split: {
|
|
|
13171
12941
|
predicate: Predicate<NoInfer<A>>
|
|
13172
12942
|
): Stream<Arr.NonEmptyReadonlyArray<A>, E, R> =>
|
|
13173
12943
|
mapAccumArray(self, Arr.empty<A>, (acc, arr) => {
|
|
13174
|
-
const out = Arr.empty
|
|
13175
|
-
* Splits the stream into non-empty groups whenever the predicate matches.
|
|
13176
|
-
*
|
|
13177
|
-
* **Details**
|
|
13178
|
-
*
|
|
13179
|
-
* Matching elements act as delimiters and are not included in the output.
|
|
13180
|
-
*
|
|
13181
|
-
* **Example** (Splitting on matching values)
|
|
13182
|
-
*
|
|
13183
|
-
* ```ts import.meta.vitest
|
|
13184
|
-
* import { Effect, Stream } from "effect"
|
|
13185
|
-
*
|
|
13186
|
-
* const program = Effect.gen(function*() {
|
|
13187
|
-
* const result = yield* Stream.range(0, 9).pipe(
|
|
13188
|
-
* Stream.split((n) => n % 4 === 0),
|
|
13189
|
-
* Stream.runCollect
|
|
13190
|
-
* )
|
|
13191
|
-
* result // => [ [ 1, 2, 3 ], [ 5, 6, 7 ], [ 9 ] ]
|
|
13192
|
-
* })
|
|
13193
|
-
*
|
|
13194
|
-
* await Effect.runPromise(program)
|
|
13195
|
-
* ```
|
|
13196
|
-
*
|
|
13197
|
-
* @stability stable
|
|
13198
|
-
* @category grouping
|
|
13199
|
-
* @since 2.0.0
|
|
13200
|
-
*/
|
|
13201
|
-
Arr.NonEmptyReadonlyArray<A>>()
|
|
12944
|
+
const out = Arr.empty<Arr.NonEmptyReadonlyArray<A>>()
|
|
13202
12945
|
for (let i = 0; i < arr.length; i++) {
|
|
13203
12946
|
if (predicate(arr[i])) {
|
|
13204
12947
|
if (Arr.isArrayNonEmpty(acc)) {
|
|
@@ -13639,38 +13382,13 @@ export const mapAccum: {
|
|
|
13639
13382
|
self.channel,
|
|
13640
13383
|
initial,
|
|
13641
13384
|
(state, arr) => {
|
|
13642
|
-
const acc = Arr.empty
|
|
13643
|
-
* Maps elements statefully, emitting zero or more outputs per input.
|
|
13644
|
-
*
|
|
13645
|
-
* **Example** (Statefully mapping stream values)
|
|
13646
|
-
*
|
|
13647
|
-
* ```ts import.meta.vitest
|
|
13648
|
-
* import { Console, Effect, Stream } from "effect"
|
|
13649
|
-
*
|
|
13650
|
-
* const program = Effect.gen(function*() {
|
|
13651
|
-
* const totals = yield* Stream.make(0, 1, 2, 3, 4, 5, 6).pipe(
|
|
13652
|
-
* Stream.mapAccum(() => 0, (total, n) => {
|
|
13653
|
-
* const next = total + n
|
|
13654
|
-
* return [next, [next]] as const
|
|
13655
|
-
* }),
|
|
13656
|
-
* Stream.runCollect
|
|
13657
|
-
* )
|
|
13658
|
-
*
|
|
13659
|
-
* totals // => [0, 1, 3, 6, 10, 15, 21]
|
|
13660
|
-
* })
|
|
13661
|
-
*
|
|
13662
|
-
* await Effect.runPromise(program)
|
|
13663
|
-
* ```
|
|
13664
|
-
*
|
|
13665
|
-
* @stability stable
|
|
13666
|
-
* @category mapping
|
|
13667
|
-
* @since 2.0.0
|
|
13668
|
-
*/
|
|
13669
|
-
B>()
|
|
13385
|
+
const acc = Arr.empty<B>()
|
|
13670
13386
|
for (let index = 0; index < arr.length; index++) {
|
|
13671
13387
|
const [newState, values] = f(state, arr[index])
|
|
13672
13388
|
state = newState
|
|
13673
|
-
|
|
13389
|
+
for (let i = 0; i < values.length; i++) {
|
|
13390
|
+
acc.push(values[i])
|
|
13391
|
+
}
|
|
13674
13392
|
}
|
|
13675
13393
|
return [state, Arr.isArrayNonEmpty(acc) ? Arr.of(acc) : emptyArr]
|
|
13676
13394
|
},
|
|
@@ -13968,45 +13686,7 @@ export const mapAccumEffect: {
|
|
|
13968
13686
|
f(state, a),
|
|
13969
13687
|
([state, values]) => [
|
|
13970
13688
|
state,
|
|
13971
|
-
Arr.isReadonlyArrayNonEmpty(values) ? Arr.of(values) : Arr.empty
|
|
13972
|
-
* Maps each element statefully and effectfully, emitting zero or more output
|
|
13973
|
-
* values per input.
|
|
13974
|
-
*
|
|
13975
|
-
* **When to use**
|
|
13976
|
-
*
|
|
13977
|
-
* Use when stateful element mapping needs Effects or can fail while emitting
|
|
13978
|
-
* zero or more values per input element.
|
|
13979
|
-
*
|
|
13980
|
-
* **Details**
|
|
13981
|
-
*
|
|
13982
|
-
* The mapping effect receives the current state and element, then returns the
|
|
13983
|
-
* next state plus the values to emit. The state is threaded through the
|
|
13984
|
-
* stream.
|
|
13985
|
-
*
|
|
13986
|
-
* **Example** (Effectfully mapping stream values with state)
|
|
13987
|
-
*
|
|
13988
|
-
* ```ts import.meta.vitest
|
|
13989
|
-
* import { Effect, Stream } from "effect"
|
|
13990
|
-
*
|
|
13991
|
-
* const program = Effect.gen(function*() {
|
|
13992
|
-
* const result = yield* Stream.make(1, 1, 1).pipe(
|
|
13993
|
-
* Stream.mapAccumEffect(() => 0, (total, n) =>
|
|
13994
|
-
* Effect.succeed([total + n, [total + n]])
|
|
13995
|
-
* ),
|
|
13996
|
-
* Stream.runCollect
|
|
13997
|
-
* )
|
|
13998
|
-
*
|
|
13999
|
-
* result // => [ 1, 2, 3 ]
|
|
14000
|
-
* })
|
|
14001
|
-
*
|
|
14002
|
-
* await Effect.runPromise(program)
|
|
14003
|
-
* ```
|
|
14004
|
-
*
|
|
14005
|
-
* @stability stable
|
|
14006
|
-
* @category mapping
|
|
14007
|
-
* @since 2.0.0
|
|
14008
|
-
*/
|
|
14009
|
-
Arr.NonEmptyReadonlyArray<B>>()
|
|
13689
|
+
Arr.isReadonlyArrayNonEmpty(values) ? Arr.of(values) : Arr.empty<Arr.NonEmptyReadonlyArray<B>>()
|
|
14010
13690
|
]
|
|
14011
13691
|
),
|
|
14012
13692
|
options?.onHalt ?
|
|
@@ -14270,37 +13950,14 @@ export const scan: {
|
|
|
14270
13950
|
return concat(
|
|
14271
13951
|
succeed(seed),
|
|
14272
13952
|
fromChannel(Channel.mapAccum(self.channel, () => seed, (state, arr) => {
|
|
14273
|
-
const states = Arr.empty
|
|
14274
|
-
* Accumulates state across the stream, emitting the initial state and each updated state.
|
|
14275
|
-
*
|
|
14276
|
-
* **Example** (Scanning stream state)
|
|
14277
|
-
*
|
|
14278
|
-
* ```ts import.meta.vitest
|
|
14279
|
-
* import { Effect, Stream } from "effect"
|
|
14280
|
-
*
|
|
14281
|
-
* const program = Effect.gen(function*() {
|
|
14282
|
-
* const values = yield* Stream.make(1, 2, 3).pipe(
|
|
14283
|
-
* Stream.scan(() => 0, (acc, n) => acc + n),
|
|
14284
|
-
* Stream.runCollect
|
|
14285
|
-
* )
|
|
14286
|
-
* values // => [ 0, 1, 3, 6 ]
|
|
14287
|
-
* })
|
|
14288
|
-
*
|
|
14289
|
-
* await Effect.runPromise(program)
|
|
14290
|
-
* ```
|
|
14291
|
-
*
|
|
14292
|
-
* @stability stable
|
|
14293
|
-
* @category accumulation
|
|
14294
|
-
* @since 2.0.0
|
|
14295
|
-
*/
|
|
14296
|
-
S>() as Arr.NonEmptyArray<S>
|
|
13953
|
+
const states = Arr.empty<S>() as Arr.NonEmptyArray<S>
|
|
14297
13954
|
for (let index = 0; index < arr.length; index++) {
|
|
14298
13955
|
state = f(state, arr[index])
|
|
14299
13956
|
states.push(state)
|
|
14300
13957
|
}
|
|
14301
13958
|
return [state, Arr.of(states)]
|
|
14302
13959
|
}))
|
|
14303
|
-
)
|
|
13960
|
+
)
|
|
14304
13961
|
}))
|
|
14305
13962
|
|
|
14306
13963
|
/**
|
|
@@ -15397,67 +15054,7 @@ export const groupByKey: {
|
|
|
15397
15054
|
}
|
|
15398
15055
|
): Stream<readonly [K, Stream<A>], E, R> =>
|
|
15399
15056
|
suspend(() => {
|
|
15400
|
-
const batch = MutableHashMap.empty
|
|
15401
|
-
* Groups elements by a key and emits a stream per key.
|
|
15402
|
-
*
|
|
15403
|
-
* **Example** (Grouping elements by key)
|
|
15404
|
-
*
|
|
15405
|
-
* ```ts import.meta.vitest
|
|
15406
|
-
* import { Effect, Stream } from "effect"
|
|
15407
|
-
*
|
|
15408
|
-
* const program = Effect.gen(function*() {
|
|
15409
|
-
* const grouped = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
15410
|
-
* Stream.groupByKey((n) => n % 2 === 0 ? "even" : "odd"),
|
|
15411
|
-
* Stream.mapEffect(
|
|
15412
|
-
* ([key, stream]) =>
|
|
15413
|
-
* Stream.runCollect(stream).pipe(
|
|
15414
|
-
* Effect.map((values) => [key, values] as const)
|
|
15415
|
-
* ),
|
|
15416
|
-
* { concurrency: "unbounded" }
|
|
15417
|
-
* ),
|
|
15418
|
-
* Stream.runCollect
|
|
15419
|
-
* )
|
|
15420
|
-
* grouped // => [ [ 'odd', [ 1, 3, 5 ] ], [ 'even', [ 2, 4 ] ] ]
|
|
15421
|
-
* })
|
|
15422
|
-
*
|
|
15423
|
-
* await Effect.runPromise(program)
|
|
15424
|
-
* ```
|
|
15425
|
-
*
|
|
15426
|
-
* @stability stable
|
|
15427
|
-
* @category grouping
|
|
15428
|
-
* @since 2.0.0
|
|
15429
|
-
*/
|
|
15430
|
-
K, /**
|
|
15431
|
-
* Groups elements by a key and emits a stream per key.
|
|
15432
|
-
*
|
|
15433
|
-
* **Example** (Grouping elements by key)
|
|
15434
|
-
*
|
|
15435
|
-
* ```ts import.meta.vitest
|
|
15436
|
-
* import { Effect, Stream } from "effect"
|
|
15437
|
-
*
|
|
15438
|
-
* const program = Effect.gen(function*() {
|
|
15439
|
-
* const grouped = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
15440
|
-
* Stream.groupByKey((n) => n % 2 === 0 ? "even" : "odd"),
|
|
15441
|
-
* Stream.mapEffect(
|
|
15442
|
-
* ([key, stream]) =>
|
|
15443
|
-
* Stream.runCollect(stream).pipe(
|
|
15444
|
-
* Effect.map((values) => [key, values] as const)
|
|
15445
|
-
* ),
|
|
15446
|
-
* { concurrency: "unbounded" }
|
|
15447
|
-
* ),
|
|
15448
|
-
* Stream.runCollect
|
|
15449
|
-
* )
|
|
15450
|
-
* grouped // => [ [ 'odd', [ 1, 3, 5 ] ], [ 'even', [ 2, 4 ] ] ]
|
|
15451
|
-
* })
|
|
15452
|
-
*
|
|
15453
|
-
* await Effect.runPromise(program)
|
|
15454
|
-
* ```
|
|
15455
|
-
*
|
|
15456
|
-
* @stability stable
|
|
15457
|
-
* @category grouping
|
|
15458
|
-
* @since 2.0.0
|
|
15459
|
-
*/
|
|
15460
|
-
Arr.NonEmptyArray<A>>()
|
|
15057
|
+
const batch = MutableHashMap.empty<K, Arr.NonEmptyArray<A>>()
|
|
15461
15058
|
return groupByImpl(
|
|
15462
15059
|
self,
|
|
15463
15060
|
Effect.fnUntraced(function*(arr, queues, queueMap) {
|
|
@@ -15610,29 +15207,7 @@ export const groupAdjacentBy: {
|
|
|
15610
15207
|
Effect.sync(() => {
|
|
15611
15208
|
let currentKey: K = undefined as any
|
|
15612
15209
|
let group: Arr.NonEmptyArray<A> | undefined
|
|
15613
|
-
let toEmit = Arr.empty
|
|
15614
|
-
* Groups consecutive elements that have equal keys into non-empty arrays.
|
|
15615
|
-
*
|
|
15616
|
-
* **When to use**
|
|
15617
|
-
*
|
|
15618
|
-
* Use when you already have a stream ordered by the grouping key and want to
|
|
15619
|
-
* emit each consecutive run as a non-empty array while keeping later
|
|
15620
|
-
* non-adjacent runs separate.
|
|
15621
|
-
*
|
|
15622
|
-
* **Details**
|
|
15623
|
-
*
|
|
15624
|
-
* The key is computed with `f`; adjacent elements whose keys are equal by
|
|
15625
|
-
* `Equal.equals` are emitted as one `[key, group]`. Later non-adjacent runs
|
|
15626
|
-
* with the same key are emitted separately.
|
|
15627
|
-
*
|
|
15628
|
-
* @see {@link groupByKey} for grouping all elements with the same key across the stream
|
|
15629
|
-
* @see {@link groupBy} for custom grouped stream construction
|
|
15630
|
-
*
|
|
15631
|
-
* @stability stable
|
|
15632
|
-
* @category grouping
|
|
15633
|
-
* @since 2.0.0
|
|
15634
|
-
*/
|
|
15635
|
-
readonly [K, Arr.NonEmptyArray<A>]>()
|
|
15210
|
+
let toEmit = Arr.empty<readonly [K, Arr.NonEmptyArray<A>]>()
|
|
15636
15211
|
const loop: Pull.Pull<
|
|
15637
15212
|
Arr.NonEmptyReadonlyArray<readonly [K, Arr.NonEmptyArray<A>]>,
|
|
15638
15213
|
E
|
|
@@ -16019,89 +15594,7 @@ export const aggregateWithin: {
|
|
|
16019
15594
|
|
|
16020
15595
|
const pullLatch = Latch.makeUnsafe(false)
|
|
16021
15596
|
const scheduleStep = Symbol()
|
|
16022
|
-
const buffer = yield* Queue.make
|
|
16023
|
-
* Aggregates elements with a sink, emitting each result when the sink completes or the schedule triggers.
|
|
16024
|
-
*
|
|
16025
|
-
* **Details**
|
|
16026
|
-
*
|
|
16027
|
-
* The schedule can flush the current aggregation even if the sink has not finished.
|
|
16028
|
-
* It is stepped at most once per aggregation, when the aggregation receives its
|
|
16029
|
-
* first element, with the previous aggregation's output as input. An aggregation
|
|
16030
|
-
* the sink completes immediately, such as one built from leftovers, may finish
|
|
16031
|
-
* without stepping the schedule.
|
|
16032
|
-
*
|
|
16033
|
-
* Time between aggregations is hidden from the schedule, so an idle stream does
|
|
16034
|
-
* not run it. Time-based schedules such as `Schedule.fixed` and
|
|
16035
|
-
* `Schedule.upTo({ duration })` only count time spent aggregating; use
|
|
16036
|
-
* `Schedule.spaced` for a flush timer.
|
|
16037
|
-
*
|
|
16038
|
-
* When the schedule ends, the stream emits the current aggregation and any sink
|
|
16039
|
-
* leftovers, then ends without pulling more from upstream.
|
|
16040
|
-
*
|
|
16041
|
-
* **Example** (Aggregating with a sink and schedule)
|
|
16042
|
-
*
|
|
16043
|
-
* ```ts import.meta.vitest
|
|
16044
|
-
* import { Effect, Schedule, Sink, Stream } from "effect"
|
|
16045
|
-
*
|
|
16046
|
-
* await Effect.runPromise(Effect.gen(function* () {
|
|
16047
|
-
* const aggregated = yield* Stream.runCollect(
|
|
16048
|
-
* Stream.make(1, 2, 3, 4, 5, 6).pipe(
|
|
16049
|
-
* Stream.aggregateWithin(
|
|
16050
|
-
* Sink.foldUntil(() => 0, 3, (sum, n) => Effect.succeed(sum + n)),
|
|
16051
|
-
* Schedule.forever
|
|
16052
|
-
* )
|
|
16053
|
-
* )
|
|
16054
|
-
* )
|
|
16055
|
-
* aggregated // => [ 6, 15 ]
|
|
16056
|
-
* }))
|
|
16057
|
-
* ```
|
|
16058
|
-
*
|
|
16059
|
-
* @stability stable
|
|
16060
|
-
* @category aggregation
|
|
16061
|
-
* @since 2.0.0
|
|
16062
|
-
*/
|
|
16063
|
-
Arr.NonEmptyReadonlyArray<A> | typeof scheduleStep, /**
|
|
16064
|
-
* Aggregates elements with a sink, emitting each result when the sink completes or the schedule triggers.
|
|
16065
|
-
*
|
|
16066
|
-
* **Details**
|
|
16067
|
-
*
|
|
16068
|
-
* The schedule can flush the current aggregation even if the sink has not finished.
|
|
16069
|
-
* It is stepped at most once per aggregation, when the aggregation receives its
|
|
16070
|
-
* first element, with the previous aggregation's output as input. An aggregation
|
|
16071
|
-
* the sink completes immediately, such as one built from leftovers, may finish
|
|
16072
|
-
* without stepping the schedule.
|
|
16073
|
-
*
|
|
16074
|
-
* Time between aggregations is hidden from the schedule, so an idle stream does
|
|
16075
|
-
* not run it. Time-based schedules such as `Schedule.fixed` and
|
|
16076
|
-
* `Schedule.upTo({ duration })` only count time spent aggregating; use
|
|
16077
|
-
* `Schedule.spaced` for a flush timer.
|
|
16078
|
-
*
|
|
16079
|
-
* When the schedule ends, the stream emits the current aggregation and any sink
|
|
16080
|
-
* leftovers, then ends without pulling more from upstream.
|
|
16081
|
-
*
|
|
16082
|
-
* **Example** (Aggregating with a sink and schedule)
|
|
16083
|
-
*
|
|
16084
|
-
* ```ts import.meta.vitest
|
|
16085
|
-
* import { Effect, Schedule, Sink, Stream } from "effect"
|
|
16086
|
-
*
|
|
16087
|
-
* await Effect.runPromise(Effect.gen(function* () {
|
|
16088
|
-
* const aggregated = yield* Stream.runCollect(
|
|
16089
|
-
* Stream.make(1, 2, 3, 4, 5, 6).pipe(
|
|
16090
|
-
* Stream.aggregateWithin(
|
|
16091
|
-
* Sink.foldUntil(() => 0, 3, (sum, n) => Effect.succeed(sum + n)),
|
|
16092
|
-
* Schedule.forever
|
|
16093
|
-
* )
|
|
16094
|
-
* )
|
|
16095
|
-
* )
|
|
16096
|
-
* aggregated // => [ 6, 15 ]
|
|
16097
|
-
* }))
|
|
16098
|
-
* ```
|
|
16099
|
-
*
|
|
16100
|
-
* @stability stable
|
|
16101
|
-
* @category aggregation
|
|
16102
|
-
* @since 2.0.0
|
|
16103
|
-
*/
|
|
16104
|
-
E | Cause.Done<void>>({
|
|
15597
|
+
const buffer = yield* Queue.make<Arr.NonEmptyReadonlyArray<A> | typeof scheduleStep, E | Cause.Done<void>>({
|
|
16105
15598
|
capacity: 0
|
|
16106
15599
|
})
|
|
16107
15600
|
|
|
@@ -16122,48 +15615,7 @@ export const aggregateWithin: {
|
|
|
16122
15615
|
const hasInput = Latch.makeUnsafe(false)
|
|
16123
15616
|
let scheduleTime = clock.currentTimeMillisUnsafe()
|
|
16124
15617
|
let openedAt = 0
|
|
16125
|
-
let lastOutput = Option.none
|
|
16126
|
-
* Aggregates elements with a sink, emitting each result when the sink completes or the schedule triggers.
|
|
16127
|
-
*
|
|
16128
|
-
* **Details**
|
|
16129
|
-
*
|
|
16130
|
-
* The schedule can flush the current aggregation even if the sink has not finished.
|
|
16131
|
-
* It is stepped at most once per aggregation, when the aggregation receives its
|
|
16132
|
-
* first element, with the previous aggregation's output as input. An aggregation
|
|
16133
|
-
* the sink completes immediately, such as one built from leftovers, may finish
|
|
16134
|
-
* without stepping the schedule.
|
|
16135
|
-
*
|
|
16136
|
-
* Time between aggregations is hidden from the schedule, so an idle stream does
|
|
16137
|
-
* not run it. Time-based schedules such as `Schedule.fixed` and
|
|
16138
|
-
* `Schedule.upTo({ duration })` only count time spent aggregating; use
|
|
16139
|
-
* `Schedule.spaced` for a flush timer.
|
|
16140
|
-
*
|
|
16141
|
-
* When the schedule ends, the stream emits the current aggregation and any sink
|
|
16142
|
-
* leftovers, then ends without pulling more from upstream.
|
|
16143
|
-
*
|
|
16144
|
-
* **Example** (Aggregating with a sink and schedule)
|
|
16145
|
-
*
|
|
16146
|
-
* ```ts import.meta.vitest
|
|
16147
|
-
* import { Effect, Schedule, Sink, Stream } from "effect"
|
|
16148
|
-
*
|
|
16149
|
-
* await Effect.runPromise(Effect.gen(function* () {
|
|
16150
|
-
* const aggregated = yield* Stream.runCollect(
|
|
16151
|
-
* Stream.make(1, 2, 3, 4, 5, 6).pipe(
|
|
16152
|
-
* Stream.aggregateWithin(
|
|
16153
|
-
* Sink.foldUntil(() => 0, 3, (sum, n) => Effect.succeed(sum + n)),
|
|
16154
|
-
* Schedule.forever
|
|
16155
|
-
* )
|
|
16156
|
-
* )
|
|
16157
|
-
* )
|
|
16158
|
-
* aggregated // => [ 6, 15 ]
|
|
16159
|
-
* }))
|
|
16160
|
-
* ```
|
|
16161
|
-
*
|
|
16162
|
-
* @stability stable
|
|
16163
|
-
* @category aggregation
|
|
16164
|
-
* @since 2.0.0
|
|
16165
|
-
*/
|
|
16166
|
-
B>()
|
|
15618
|
+
let lastOutput = Option.none<B>()
|
|
16167
15619
|
let leftover: Arr.NonEmptyReadonlyArray<A2> | undefined
|
|
16168
15620
|
const onInput = <X>(chunk: X): Effect.Effect<X> => {
|
|
16169
15621
|
if (hasInput.openUnsafe()) {
|
|
@@ -16374,47 +15826,7 @@ export const broadcastN: {
|
|
|
16374
15826
|
}
|
|
16375
15827
|
) {
|
|
16376
15828
|
const n = Count.normalize(options.n)
|
|
16377
|
-
const pubsub = yield* makePubSub
|
|
16378
|
-
* Creates a fixed-size tuple of streams that each emit
|
|
16379
|
-
* the same elements as the source stream.
|
|
16380
|
-
*
|
|
16381
|
-
* **Details**
|
|
16382
|
-
*
|
|
16383
|
-
* The source stream starts after all downstream streams have been subscribed.
|
|
16384
|
-
* With the default suspend strategy, the source can only advance `capacity`
|
|
16385
|
-
* chunks ahead of the slowest downstream stream. If a downstream stream is
|
|
16386
|
-
* interrupted, it unsubscribes from the broadcast so it no longer contributes
|
|
16387
|
-
* backpressure. Finite fractional values of `n` are rounded down. `NaN` and
|
|
16388
|
-
* non-positive values create no downstream streams.
|
|
16389
|
-
*
|
|
16390
|
-
* **Example** (Broadcasting to two consumers)
|
|
16391
|
-
*
|
|
16392
|
-
* ```ts import.meta.vitest
|
|
16393
|
-
* import { Effect, Stream } from "effect"
|
|
16394
|
-
*
|
|
16395
|
-
* const program = Effect.scoped(
|
|
16396
|
-
* Effect.gen(function*() {
|
|
16397
|
-
* const [left, right] = yield* Stream.make(1, 2, 3).pipe(
|
|
16398
|
-
* Stream.broadcastN({ n: 2, capacity: 8 })
|
|
16399
|
-
* )
|
|
16400
|
-
*
|
|
16401
|
-
* const values = yield* Effect.all([
|
|
16402
|
-
* Stream.runCollect(left),
|
|
16403
|
-
* Stream.runCollect(right)
|
|
16404
|
-
* ], { concurrency: "unbounded" })
|
|
16405
|
-
*
|
|
16406
|
-
* values // => [ [ 1, 2, 3 ], [ 1, 2, 3 ] ]
|
|
16407
|
-
* })
|
|
16408
|
-
* )
|
|
16409
|
-
*
|
|
16410
|
-
* await Effect.runPromise(program)
|
|
16411
|
-
* ```
|
|
16412
|
-
*
|
|
16413
|
-
* @stability stable
|
|
16414
|
-
* @category broadcasting
|
|
16415
|
-
* @since 4.0.0
|
|
16416
|
-
*/
|
|
16417
|
-
Take.Take<A, E>>(options)
|
|
15829
|
+
const pubsub = yield* makePubSub<Take.Take<A, E>>(options)
|
|
16418
15830
|
const streams = new Array(n)
|
|
16419
15831
|
const parentScope = yield* Scope.Scope
|
|
16420
15832
|
for (let i = 0; i < n; i++) {
|
|
@@ -17469,10 +16881,10 @@ export const decodeText: <
|
|
|
17469
16881
|
<E, R>(self: Stream<Uint8Array, E, R>, options?: {
|
|
17470
16882
|
readonly encoding?: string | undefined
|
|
17471
16883
|
}): Stream<string, E, R> =>
|
|
17472
|
-
|
|
17473
|
-
|
|
17474
|
-
|
|
17475
|
-
|
|
16884
|
+
self.channel.pipe(
|
|
16885
|
+
Channel.pipeTo(Channel.decodeText(options?.encoding)),
|
|
16886
|
+
fromChannel
|
|
16887
|
+
)
|
|
17476
16888
|
)
|
|
17477
16889
|
|
|
17478
16890
|
/**
|
|
@@ -17923,39 +17335,7 @@ export const interleaveWith: {
|
|
|
17923
17335
|
)).pipe(
|
|
17924
17336
|
Pull.catchDone(() => {
|
|
17925
17337
|
leftDone = true
|
|
17926
|
-
return Effect.succeed
|
|
17927
|
-
* Interleaves two streams deterministically by following a boolean decider stream.
|
|
17928
|
-
*
|
|
17929
|
-
* **Details**
|
|
17930
|
-
*
|
|
17931
|
-
* The decider controls how many elements are pulled; if one side ends, pulls for
|
|
17932
|
-
* that side are ignored.
|
|
17933
|
-
*
|
|
17934
|
-
* **Example** (Interleaving two streams deterministically by following a boolean decider stream)
|
|
17935
|
-
*
|
|
17936
|
-
* ```ts import.meta.vitest
|
|
17937
|
-
* import { Effect, Stream } from "effect"
|
|
17938
|
-
*
|
|
17939
|
-
* const program = Effect.gen(function*() {
|
|
17940
|
-
* const left = Stream.make(1, 3, 5)
|
|
17941
|
-
* const right = Stream.make(2, 4, 6)
|
|
17942
|
-
* const decider = Stream.make(true, false, false, true, true)
|
|
17943
|
-
*
|
|
17944
|
-
* const values = yield* Stream.runCollect(
|
|
17945
|
-
* Stream.interleaveWith(left, right, decider)
|
|
17946
|
-
* )
|
|
17947
|
-
*
|
|
17948
|
-
* values // => [ 1, 2, 4, 3, 5 ]
|
|
17949
|
-
* })
|
|
17950
|
-
*
|
|
17951
|
-
* await Effect.runPromise(program)
|
|
17952
|
-
* ```
|
|
17953
|
-
*
|
|
17954
|
-
* @stability stable
|
|
17955
|
-
* @category merging
|
|
17956
|
-
* @since 2.0.0
|
|
17957
|
-
*/
|
|
17958
|
-
retry>(retry);
|
|
17338
|
+
return Effect.succeed<retry>(retry)
|
|
17959
17339
|
})
|
|
17960
17340
|
)
|
|
17961
17341
|
const pullRight = (yield* Channel.toTransform(Channel.flattenArray(that.channel))(
|
|
@@ -17964,39 +17344,7 @@ export const interleaveWith: {
|
|
|
17964
17344
|
)).pipe(
|
|
17965
17345
|
Pull.catchDone(() => {
|
|
17966
17346
|
rightDone = true
|
|
17967
|
-
return Effect.succeed
|
|
17968
|
-
* Interleaves two streams deterministically by following a boolean decider stream.
|
|
17969
|
-
*
|
|
17970
|
-
* **Details**
|
|
17971
|
-
*
|
|
17972
|
-
* The decider controls how many elements are pulled; if one side ends, pulls for
|
|
17973
|
-
* that side are ignored.
|
|
17974
|
-
*
|
|
17975
|
-
* **Example** (Interleaving two streams deterministically by following a boolean decider stream)
|
|
17976
|
-
*
|
|
17977
|
-
* ```ts import.meta.vitest
|
|
17978
|
-
* import { Effect, Stream } from "effect"
|
|
17979
|
-
*
|
|
17980
|
-
* const program = Effect.gen(function*() {
|
|
17981
|
-
* const left = Stream.make(1, 3, 5)
|
|
17982
|
-
* const right = Stream.make(2, 4, 6)
|
|
17983
|
-
* const decider = Stream.make(true, false, false, true, true)
|
|
17984
|
-
*
|
|
17985
|
-
* const values = yield* Stream.runCollect(
|
|
17986
|
-
* Stream.interleaveWith(left, right, decider)
|
|
17987
|
-
* )
|
|
17988
|
-
*
|
|
17989
|
-
* values // => [ 1, 2, 4, 3, 5 ]
|
|
17990
|
-
* })
|
|
17991
|
-
*
|
|
17992
|
-
* await Effect.runPromise(program)
|
|
17993
|
-
* ```
|
|
17994
|
-
*
|
|
17995
|
-
* @stability stable
|
|
17996
|
-
* @category merging
|
|
17997
|
-
* @since 2.0.0
|
|
17998
|
-
*/
|
|
17999
|
-
retry>(retry);
|
|
17347
|
+
return Effect.succeed<retry>(retry)
|
|
18000
17348
|
})
|
|
18001
17349
|
)
|
|
18002
17350
|
|
|
@@ -18804,7 +18152,8 @@ export const ensuring: {
|
|
|
18804
18152
|
/**
|
|
18805
18153
|
* Provides a layer or context to the stream, removing the corresponding
|
|
18806
18154
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
18807
|
-
* default,
|
|
18155
|
+
* default, a layer already built by an enclosing provide or runtime is reused;
|
|
18156
|
+
* sibling provide calls build their own copies.
|
|
18808
18157
|
*
|
|
18809
18158
|
* **Example** (Providing stream requirements)
|
|
18810
18159
|
*
|
|
@@ -18835,7 +18184,8 @@ export const provide: {
|
|
|
18835
18184
|
/**
|
|
18836
18185
|
* Provides a layer or context to the stream, removing the corresponding
|
|
18837
18186
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
18838
|
-
* default,
|
|
18187
|
+
* default, a layer already built by an enclosing provide or runtime is reused;
|
|
18188
|
+
* sibling provide calls build their own copies.
|
|
18839
18189
|
*
|
|
18840
18190
|
* **Example** (Providing stream requirements)
|
|
18841
18191
|
*
|
|
@@ -18873,7 +18223,8 @@ export const provide: {
|
|
|
18873
18223
|
/**
|
|
18874
18224
|
* Provides a layer or context to the stream, removing the corresponding
|
|
18875
18225
|
* service requirements. Use `options.local` to build the layer every time; by
|
|
18876
|
-
* default,
|
|
18226
|
+
* default, a layer already built by an enclosing provide or runtime is reused;
|
|
18227
|
+
* sibling provide calls build their own copies.
|
|
18877
18228
|
*
|
|
18878
18229
|
* **Example** (Providing stream requirements)
|
|
18879
18230
|
*
|
|
@@ -20752,7 +20103,7 @@ export const mkArrayBuffer = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effe
|
|
|
20752
20103
|
* @category destructors
|
|
20753
20104
|
* @since 4.0.0
|
|
20754
20105
|
*/
|
|
20755
|
-
export const mkUint8Array = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effect<Uint8Array
|
|
20106
|
+
export const mkUint8Array = <E, R>(self: Stream<Uint8Array, E, R>): Effect.Effect<Uint8Array<ArrayBuffer>, E, R> =>
|
|
20756
20107
|
Channel.mkUint8Array(self.channel)
|
|
20757
20108
|
|
|
20758
20109
|
/**
|
|
@@ -20882,15 +20233,18 @@ export const toReadableStreamWith: {
|
|
|
20882
20233
|
return new ReadableStream<A>({
|
|
20883
20234
|
start(controller) {
|
|
20884
20235
|
fiber = Effect.runFork(Effect.provideContext(
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
|
|
20888
|
-
|
|
20889
|
-
|
|
20890
|
-
|
|
20891
|
-
|
|
20892
|
-
|
|
20893
|
-
|
|
20236
|
+
Channel.runForEach(
|
|
20237
|
+
Channel.transformPull(self.channel, (pull) => Effect.succeed(latch.whenOpen(pull))),
|
|
20238
|
+
(chunk) =>
|
|
20239
|
+
Effect.sync(() => {
|
|
20240
|
+
latch.closeUnsafe()
|
|
20241
|
+
for (let i = 0; i < chunk.length; i++) {
|
|
20242
|
+
controller.enqueue(chunk[i])
|
|
20243
|
+
}
|
|
20244
|
+
currentResolve!()
|
|
20245
|
+
currentResolve = undefined
|
|
20246
|
+
})
|
|
20247
|
+
),
|
|
20894
20248
|
context
|
|
20895
20249
|
))
|
|
20896
20250
|
fiber.addObserver((exit) => {
|
|
@@ -21109,38 +20463,7 @@ export const toReadableStreamEffect: {
|
|
|
21109
20463
|
options?: { readonly strategy?: QueuingStrategy<A> | undefined }
|
|
21110
20464
|
): Effect.Effect<ReadableStream<A>, never, R> =>
|
|
21111
20465
|
Effect.map(
|
|
21112
|
-
Effect.context
|
|
21113
|
-
* Creates an Effect that builds a ReadableStream from the stream.
|
|
21114
|
-
*
|
|
21115
|
-
* **When to use**
|
|
21116
|
-
*
|
|
21117
|
-
* Use when bridging to Web Streams from inside an `Effect` so the required
|
|
21118
|
-
* services can be captured from the current context.
|
|
21119
|
-
*
|
|
21120
|
-
* **Details**
|
|
21121
|
-
*
|
|
21122
|
-
* See https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream.
|
|
21123
|
-
*
|
|
21124
|
-
* **Example** (Creating a ReadableStream effect)
|
|
21125
|
-
*
|
|
21126
|
-
* ```ts import.meta.vitest
|
|
21127
|
-
* import { Effect, Stream } from "effect"
|
|
21128
|
-
*
|
|
21129
|
-
* const stream = Stream.make(1, 2, 3, 4, 5)
|
|
21130
|
-
*
|
|
21131
|
-
* const effect = Effect.gen(function*() {
|
|
21132
|
-
* const readableStream = yield* Stream.toReadableStreamEffect(stream)
|
|
21133
|
-
* readableStream instanceof ReadableStream // => true
|
|
21134
|
-
* })
|
|
21135
|
-
*
|
|
21136
|
-
* await Effect.runPromise(effect)
|
|
21137
|
-
* ```
|
|
21138
|
-
*
|
|
21139
|
-
* @stability stable
|
|
21140
|
-
* @category destructors
|
|
21141
|
-
* @since 2.0.0
|
|
21142
|
-
*/
|
|
21143
|
-
R>(),
|
|
20466
|
+
Effect.context<R>(),
|
|
21144
20467
|
(context) => toReadableStreamWith(self, context, options)
|
|
21145
20468
|
)
|
|
21146
20469
|
)
|