effect 4.0.0-beta.3 → 4.0.0-beta.31
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/dist/Array.d.ts +126 -299
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +102 -62
- package/dist/Array.js.map +1 -1
- package/dist/Brand.d.ts +1 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +2 -2
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +6 -5
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +2 -2
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts +118 -32
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +82 -37
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +54 -247
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +36 -67
- package/dist/Chunk.js.map +1 -1
- package/dist/Combiner.d.ts +280 -13
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +198 -7
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +165 -9
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +65 -10
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/Cron.d.ts +1 -1
- package/dist/Cron.js +3 -3
- package/dist/Cron.js.map +1 -1
- package/dist/Data.d.ts +535 -366
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +132 -79
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +56 -238
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +7 -52
- package/dist/DateTime.js.map +1 -1
- package/dist/Duration.d.ts +39 -11
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +88 -59
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +1206 -924
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +390 -329
- package/dist/Effect.js.map +1 -1
- package/dist/Encoding.d.ts +194 -0
- package/dist/Encoding.d.ts.map +1 -0
- package/dist/Encoding.js +352 -0
- package/dist/Encoding.js.map +1 -0
- package/dist/Equal.d.ts +276 -109
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +124 -48
- package/dist/Equal.js.map +1 -1
- package/dist/ErrorReporter.d.ts +374 -0
- package/dist/ErrorReporter.d.ts.map +1 -0
- package/dist/ErrorReporter.js +244 -0
- package/dist/ErrorReporter.js.map +1 -0
- package/dist/Exit.d.ts +24 -12
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +8 -4
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +3 -2
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FileSystem.d.ts +1 -1
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +5 -5
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +34 -38
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +15 -13
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +131 -47
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +229 -51
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +1 -9
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +2 -10
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +5 -8
- package/dist/Graph.js.map +1 -1
- package/dist/HashMap.d.ts +15 -14
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +4 -4
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +39 -39
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +94 -22
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonSchema.d.ts +299 -10
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +323 -4
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +109 -0
- package/dist/Latch.d.ts.map +1 -0
- package/dist/Latch.js +72 -0
- package/dist/Latch.js.map +1 -0
- package/dist/Layer.d.ts +217 -127
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +51 -46
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +8 -8
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +3 -3
- package/dist/LogLevel.d.ts +32 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +28 -100
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +29 -95
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +2 -3
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +2 -2
- package/dist/ManagedRuntime.js +2 -2
- package/dist/Metric.d.ts +4 -6
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +3 -5
- package/dist/Metric.js.map +1 -1
- package/dist/Newtype.d.ts +291 -0
- package/dist/Newtype.d.ts.map +1 -0
- package/dist/Newtype.js +161 -0
- package/dist/Newtype.js.map +1 -0
- package/dist/Optic.d.ts +947 -18
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +454 -5
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +23 -16
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +15 -9
- package/dist/Option.js.map +1 -1
- package/dist/Pipeable.d.ts +17 -0
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +19 -1
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +10 -9
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +2 -2
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +6 -4
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +7 -5
- package/dist/Pool.js.map +1 -1
- package/dist/PubSub.d.ts +3 -2
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +3 -2
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +1 -1
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +0 -1
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +35 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +46 -12
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +2 -2
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +1 -1
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +1 -1
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/Record.d.ts +23 -120
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +21 -41
- package/dist/Record.js.map +1 -1
- package/dist/Reducer.d.ts +166 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +135 -1
- package/dist/Reducer.js.map +1 -1
- package/dist/References.d.ts +9 -4
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +6 -1
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +2 -1
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +25 -45
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +10 -30
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Result.d.ts +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +1 -2
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +66 -0
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +79 -6
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +191 -102
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +152 -66
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +9 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +11 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +2647 -224
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +1863 -209
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +2 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +131 -25
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +5 -5
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +12 -14
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaParser.d.ts +5 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +10 -0
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +46 -45
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +49 -24
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +107 -3
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +159 -4
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts +2 -2
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts +211 -0
- package/dist/Semaphore.d.ts.map +1 -0
- package/dist/{PartitionedSemaphore.js → Semaphore.js} +97 -13
- package/dist/Semaphore.js.map +1 -0
- package/dist/ServiceMap.d.ts +41 -31
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +3 -3
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Sink.d.ts +13 -13
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +53 -6
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +16 -4
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +18 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +250 -428
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +137 -82
- package/dist/Stream.js.map +1 -1
- package/dist/Struct.d.ts +16 -0
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +22 -0
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +2 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +2 -1
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +2 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +2 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Trie.d.ts +18 -17
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +5 -5
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +37 -37
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +3 -3
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +328 -0
- package/dist/TxDeferred.d.ts.map +1 -0
- package/dist/TxDeferred.js +196 -0
- package/dist/TxDeferred.js.map +1 -0
- package/dist/TxHashMap.d.ts +84 -83
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +24 -24
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +35 -35
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +14 -14
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +609 -0
- package/dist/TxPriorityQueue.d.ts.map +1 -0
- package/dist/TxPriorityQueue.js +415 -0
- package/dist/TxPriorityQueue.js.map +1 -0
- package/dist/TxPubSub.d.ts +585 -0
- package/dist/TxPubSub.d.ts.map +1 -0
- package/dist/TxPubSub.js +521 -0
- package/dist/TxPubSub.js.map +1 -0
- package/dist/TxQueue.d.ts +32 -32
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +26 -26
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +523 -0
- package/dist/TxReentrantLock.d.ts.map +1 -0
- package/dist/TxReentrantLock.js +504 -0
- package/dist/TxReentrantLock.js.map +1 -0
- package/dist/TxRef.d.ts +34 -34
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +21 -14
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +8 -8
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +7 -7
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +508 -0
- package/dist/TxSubscriptionRef.d.ts.map +1 -0
- package/dist/TxSubscriptionRef.js +293 -0
- package/dist/TxSubscriptionRef.js.map +1 -0
- package/dist/Types.d.ts +80 -23
- package/dist/Types.d.ts.map +1 -1
- package/dist/Utils.d.ts +137 -65
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +38 -66
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +718 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +718 -23
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +11 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +60 -61
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +265 -127
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +5 -4
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/random.d.ts +2 -0
- package/dist/internal/random.d.ts.map +1 -0
- package/dist/internal/random.js +13 -0
- package/dist/internal/random.js.map +1 -0
- package/dist/internal/rcRef.js +3 -2
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/request.js +2 -2
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/representation.js +47 -106
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -0
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/to-codec.js +7 -10
- package/dist/internal/schema/to-codec.js.map +1 -1
- package/dist/internal/trie.js +5 -4
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts +8 -7
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +6 -4
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +266 -32
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +296 -23
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +64 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +64 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +134 -51
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +19 -16
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +7 -8
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +38 -44
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +45 -45
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +107 -124
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +183 -88
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +57 -12
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +66 -13
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +193 -51
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +25 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +22 -6
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +20 -20
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts +26 -26
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +1 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +20 -4
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +14 -9
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +4 -11
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +1 -1
- package/dist/unstable/ai/index.js +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +0 -5
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +27 -60
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +25 -57
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.js +59 -6
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +368 -56
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +325 -64
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +16 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -0
- package/dist/unstable/cli/Completions.js +23 -0
- package/dist/unstable/cli/Completions.js.map +1 -0
- package/dist/unstable/cli/GlobalFlag.d.ts +125 -0
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -0
- package/dist/unstable/cli/GlobalFlag.js +118 -0
- package/dist/unstable/cli/GlobalFlag.js.map +1 -0
- package/dist/unstable/cli/HelpDoc.d.ts +70 -2
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Prompt.js +35 -8
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +8 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +8 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +40 -14
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +72 -46
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +7 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/config.js +42 -0
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts +33 -0
- package/dist/unstable/cli/internal/help.d.ts.map +1 -0
- package/dist/unstable/cli/internal/help.js +125 -0
- package/dist/unstable/cli/internal/help.js.map +1 -0
- package/dist/unstable/cli/internal/parser.js +55 -42
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +5 -4
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +7 -6
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +4 -4
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +10 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +2 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +6 -6
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +4 -3
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +2 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +9 -7
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +21 -21
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +20 -20
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +5 -4
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js +2 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +2 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +36 -36
- package/dist/unstable/encoding/Msgpack.d.ts +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +9 -9
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +4 -4
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +1 -1
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +2 -2
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +2 -1
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +6 -6
- package/dist/unstable/http/Cookies.d.ts +47 -3
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +24 -2
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +16 -0
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +38 -10
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +3 -3
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +6 -6
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +117 -15
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +189 -12
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +7 -7
- package/dist/unstable/http/HttpClientRequest.d.ts +16 -11
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +31 -20
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +2 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +4 -0
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +7 -5
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +46 -54
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +4 -4
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +3 -3
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -6
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +8 -17
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +20 -33
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +37 -44
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +12 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +291 -1
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +2 -2
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +5 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +50 -3
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +234 -1
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +69 -0
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -0
- package/dist/unstable/http/HttpStaticServer.js +353 -0
- package/dist/unstable/http/HttpStaticServer.js.map +1 -0
- package/dist/unstable/http/Multipart.d.ts +3 -3
- package/dist/unstable/http/UrlParams.d.ts +14 -6
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +1 -1
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +4 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +4 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/preResponseHandler.d.ts +2 -0
- package/dist/unstable/http/internal/preResponseHandler.d.ts.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js +10 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +11 -5
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +28 -18
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +66 -6
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +40 -3
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +41 -54
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +17 -26
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +16 -14
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +44 -29
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +6 -0
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +32 -21
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +12 -12
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +2 -2
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +1 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -4
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +7 -4
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -4
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +6 -6
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +2 -2
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +6 -5
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +2 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +12 -12
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +12 -11
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +2 -2
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +3 -3
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +1 -1
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +5 -128
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +1 -65
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +45 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +21 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +73 -12
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +107 -20
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +10 -12
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +42 -12
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +6 -0
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +50 -9
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +9 -9
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +47 -21
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +39 -0
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -0
- package/dist/unstable/reactivity/Hydration.js +76 -0
- package/dist/unstable/reactivity/Hydration.js.map +1 -0
- package/dist/unstable/reactivity/index.d.ts +4 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +4 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +5 -5
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +5 -26
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +6 -13
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +3 -5
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +8 -8
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +13 -0
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +14 -0
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +34 -9
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +5 -9
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +17 -17
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +3 -2
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +22 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +15 -0
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +5 -5
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +6 -6
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +4 -4
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +6 -5
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +3 -3
- package/dist/unstable/sql/Migrator.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +14 -14
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +9 -3
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +3 -3
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +17 -8
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +17 -6
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +17 -7
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.js +0 -1
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +2 -1
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +3 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +3 -3
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +2 -2
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +3 -3
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +1 -1
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +12 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +137 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +2 -2
- package/src/Array.ts +192 -342
- package/src/Brand.ts +1 -1
- package/src/Cache.ts +9 -8
- package/src/Cause.ts +2 -2
- package/src/Channel.ts +557 -141
- package/src/Chunk.ts +81 -268
- package/src/Combiner.ts +280 -13
- package/src/Config.ts +186 -24
- package/src/Cron.ts +3 -3
- package/src/Data.ts +539 -376
- package/src/DateTime.ts +59 -241
- package/src/Duration.ts +91 -36
- package/src/Effect.ts +1477 -1126
- package/src/Encoding.ts +879 -0
- package/src/Equal.ts +278 -111
- package/src/ErrorReporter.ts +457 -0
- package/src/Exit.ts +24 -12
- package/src/Fiber.ts +10 -2
- package/src/FileSystem.ts +7 -8
- package/src/Filter.ts +52 -63
- package/src/Formatter.ts +253 -51
- package/src/Function.ts +2 -10
- package/src/Graph.ts +24 -11
- package/src/HashMap.ts +15 -14
- package/src/Iterable.ts +104 -50
- package/src/JsonSchema.ts +383 -10
- package/src/Latch.ts +112 -0
- package/src/Layer.ts +245 -150
- package/src/LayerMap.ts +9 -9
- package/src/LogLevel.ts +37 -0
- package/src/Logger.ts +33 -100
- package/src/ManagedRuntime.ts +2 -2
- package/src/Metric.ts +6 -8
- package/src/Newtype.ts +308 -0
- package/src/Optic.ts +948 -19
- package/src/Option.ts +32 -24
- package/src/Pipeable.ts +32 -1
- package/src/PlatformError.ts +5 -5
- package/src/Pool.ts +13 -11
- package/src/PubSub.ts +10 -9
- package/src/Pull.ts +1 -1
- package/src/Queue.ts +0 -1
- package/src/Random.ts +51 -14
- package/src/RcMap.ts +5 -5
- package/src/RcRef.ts +1 -1
- package/src/Record.ts +42 -152
- package/src/Reducer.ts +166 -7
- package/src/References.ts +10 -5
- package/src/Request.ts +3 -2
- package/src/RequestResolver.ts +29 -49
- package/src/Result.ts +2 -4
- package/src/Runtime.ts +102 -6
- package/src/Schedule.ts +462 -242
- package/src/Scheduler.ts +12 -0
- package/src/Schema.ts +3116 -312
- package/src/SchemaAST.ts +166 -33
- package/src/SchemaGetter.ts +15 -17
- package/src/SchemaParser.ts +11 -0
- package/src/SchemaRepresentation.ts +51 -26
- package/src/SchemaTransformation.ts +189 -4
- package/src/ScopedCache.ts +3 -3
- package/src/Semaphore.ts +356 -0
- package/src/ServiceMap.ts +50 -40
- package/src/Sink.ts +78 -26
- package/src/Stdio.ts +27 -4
- package/src/Stream.ts +586 -608
- package/src/Struct.ts +26 -0
- package/src/SubscriptionRef.ts +3 -2
- package/src/SynchronizedRef.ts +3 -2
- package/src/Trie.ts +18 -17
- package/src/TxChunk.ts +72 -53
- package/src/TxDeferred.ts +394 -0
- package/src/TxHashMap.ts +332 -285
- package/src/TxHashSet.ts +111 -116
- package/src/TxPriorityQueue.ts +767 -0
- package/src/TxPubSub.ts +789 -0
- package/src/TxQueue.ts +241 -251
- package/src/TxReentrantLock.ts +753 -0
- package/src/TxRef.ts +50 -38
- package/src/TxSemaphore.ts +29 -32
- package/src/TxSubscriptionRef.ts +639 -0
- package/src/Types.ts +73 -19
- package/src/Utils.ts +137 -111
- package/src/index.ts +728 -24
- package/src/internal/core.ts +12 -5
- package/src/internal/dateTime.ts +69 -81
- package/src/internal/effect.ts +775 -302
- package/src/internal/hashMap.ts +8 -7
- package/src/internal/random.ts +20 -0
- package/src/internal/rcRef.ts +4 -3
- package/src/internal/request.ts +2 -2
- package/src/internal/schema/annotations.ts +2 -0
- package/src/internal/schema/representation.ts +45 -94
- package/src/internal/schema/schema.ts +1 -0
- package/src/internal/schema/to-codec.ts +7 -17
- package/src/internal/trie.ts +15 -9
- package/src/testing/TestClock.ts +13 -11
- package/src/testing/TestSchema.ts +332 -35
- package/src/testing/index.ts +64 -1
- package/src/unstable/ai/AiError.ts +105 -48
- package/src/unstable/ai/Chat.ts +58 -74
- package/src/unstable/ai/LanguageModel.ts +294 -158
- package/src/unstable/ai/McpSchema.ts +73 -13
- package/src/unstable/ai/McpServer.ts +271 -61
- package/src/unstable/ai/Model.ts +40 -9
- package/src/unstable/ai/Prompt.ts +37 -37
- package/src/unstable/ai/Response.ts +25 -25
- package/src/unstable/ai/Tool.ts +20 -14
- package/src/unstable/ai/Toolkit.ts +5 -14
- package/src/unstable/ai/index.ts +1 -1
- package/src/unstable/ai/internal/codec-transformer.ts +0 -7
- package/src/unstable/cli/CliError.ts +47 -59
- package/src/unstable/cli/CliOutput.ts +75 -6
- package/src/unstable/cli/Command.ts +796 -187
- package/src/unstable/cli/Completions.ts +36 -0
- package/src/unstable/cli/GlobalFlag.ts +242 -0
- package/src/unstable/cli/HelpDoc.ts +80 -2
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +31 -9
- package/src/unstable/cli/index.ts +10 -0
- package/src/unstable/cli/internal/command.ts +109 -63
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +7 -2
- package/src/unstable/cli/internal/config.ts +49 -0
- package/src/unstable/cli/internal/help.ts +171 -0
- package/src/unstable/cli/internal/parser.ts +66 -61
- package/src/unstable/cluster/ClusterCron.ts +2 -2
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +6 -5
- package/src/unstable/cluster/DeliverAt.ts +1 -1
- package/src/unstable/cluster/Entity.ts +11 -10
- package/src/unstable/cluster/EntityResource.ts +4 -4
- package/src/unstable/cluster/Envelope.ts +1 -1
- package/src/unstable/cluster/K8sHttpClient.ts +5 -5
- package/src/unstable/cluster/MessageStorage.ts +3 -5
- package/src/unstable/cluster/Runners.ts +6 -5
- package/src/unstable/cluster/Sharding.ts +12 -10
- package/src/unstable/cluster/ShardingConfig.ts +30 -31
- package/src/unstable/cluster/SqlRunnerStorage.ts +1 -1
- package/src/unstable/cluster/internal/entityManager.ts +9 -8
- package/src/unstable/cluster/internal/entityReaper.ts +2 -1
- package/src/unstable/cluster/internal/resourceRef.ts +2 -1
- package/src/unstable/encoding/Ndjson.ts +17 -17
- package/src/unstable/encoding/Sse.ts +3 -5
- package/src/unstable/eventlog/EventLog.ts +2 -1
- package/src/unstable/http/Cookies.ts +87 -3
- package/src/unstable/http/Headers.ts +62 -13
- package/src/unstable/http/HttpBody.ts +6 -6
- package/src/unstable/http/HttpClient.ts +374 -33
- package/src/unstable/http/HttpClientRequest.ts +38 -30
- package/src/unstable/http/HttpClientResponse.ts +9 -4
- package/src/unstable/http/HttpEffect.ts +54 -68
- package/src/unstable/http/HttpIncomingMessage.ts +1 -1
- package/src/unstable/http/HttpMethod.ts +16 -4
- package/src/unstable/http/HttpMiddleware.ts +9 -24
- package/src/unstable/http/HttpServerError.ts +42 -45
- package/src/unstable/http/HttpServerRequest.ts +391 -4
- package/src/unstable/http/HttpServerRespondable.ts +6 -6
- package/src/unstable/http/HttpServerResponse.ts +337 -4
- package/src/unstable/http/HttpStaticServer.ts +456 -0
- package/src/unstable/http/Multipart.ts +2 -2
- package/src/unstable/http/UrlParams.ts +20 -5
- package/src/unstable/http/index.ts +5 -0
- package/src/unstable/http/internal/preResponseHandler.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +6 -6
- package/src/unstable/httpapi/HttpApiBuilder.ts +83 -30
- package/src/unstable/httpapi/HttpApiClient.ts +100 -11
- package/src/unstable/httpapi/HttpApiEndpoint.ts +71 -87
- package/src/unstable/httpapi/HttpApiError.ts +51 -28
- package/src/unstable/httpapi/HttpApiGroup.ts +7 -6
- package/src/unstable/httpapi/HttpApiMiddleware.ts +4 -4
- package/src/unstable/httpapi/HttpApiScalar.ts +6 -0
- package/src/unstable/httpapi/HttpApiSecurity.ts +3 -3
- package/src/unstable/httpapi/OpenApi.ts +41 -23
- package/src/unstable/observability/Otlp.ts +12 -12
- package/src/unstable/observability/OtlpExporter.ts +3 -3
- package/src/unstable/observability/OtlpLogger.ts +13 -9
- package/src/unstable/observability/OtlpMetrics.ts +4 -4
- package/src/unstable/observability/OtlpTracer.ts +4 -4
- package/src/unstable/persistence/KeyValueStore.ts +6 -6
- package/src/unstable/persistence/Persistable.ts +3 -3
- package/src/unstable/persistence/PersistedCache.ts +20 -9
- package/src/unstable/persistence/PersistedQueue.ts +25 -24
- package/src/unstable/persistence/Persistence.ts +3 -3
- package/src/unstable/persistence/RateLimiter.ts +4 -4
- package/src/unstable/process/ChildProcess.ts +6 -208
- package/src/unstable/process/ChildProcessSpawner.ts +75 -14
- package/src/unstable/reactivity/Atom.ts +211 -50
- package/src/unstable/reactivity/AtomHttpApi.ts +66 -31
- package/src/unstable/reactivity/AtomRegistry.ts +61 -9
- package/src/unstable/reactivity/AtomRpc.ts +51 -20
- package/src/unstable/reactivity/Hydration.ts +112 -0
- package/src/unstable/reactivity/index.ts +5 -0
- package/src/unstable/rpc/Rpc.ts +7 -9
- package/src/unstable/rpc/RpcClient.ts +12 -54
- package/src/unstable/rpc/RpcGroup.ts +7 -7
- package/src/unstable/rpc/RpcMiddleware.ts +15 -9
- package/src/unstable/rpc/RpcSchema.ts +17 -0
- package/src/unstable/rpc/RpcSerialization.ts +44 -9
- package/src/unstable/rpc/RpcServer.ts +28 -32
- package/src/unstable/rpc/Utils.ts +3 -2
- package/src/unstable/schema/Model.ts +31 -0
- package/src/unstable/schema/VariantSchema.ts +9 -9
- package/src/unstable/socket/Socket.ts +16 -17
- package/src/unstable/sql/SqlClient.ts +1 -1
- package/src/unstable/sql/SqlError.ts +11 -9
- package/src/unstable/sql/SqlModel.ts +5 -5
- package/src/unstable/sql/SqlResolver.ts +17 -7
- package/src/unstable/sql/SqlSchema.ts +42 -26
- package/src/unstable/sql/Statement.ts +0 -1
- package/src/unstable/workers/Worker.ts +2 -1
- package/src/unstable/workflow/DurableClock.ts +8 -8
- package/src/unstable/workflow/DurableDeferred.ts +2 -2
- package/src/unstable/workflow/Workflow.ts +6 -2
- package/src/unstable/workflow/WorkflowEngine.ts +185 -2
- package/dist/PartitionedSemaphore.d.ts +0 -52
- package/dist/PartitionedSemaphore.d.ts.map +0 -1
- package/dist/PartitionedSemaphore.js.map +0 -1
- package/dist/encoding/Base64.d.ts +0 -67
- package/dist/encoding/Base64.d.ts.map +0 -1
- package/dist/encoding/Base64.js +0 -146
- package/dist/encoding/Base64.js.map +0 -1
- package/dist/encoding/Base64Url.d.ts +0 -60
- package/dist/encoding/Base64Url.d.ts.map +0 -1
- package/dist/encoding/Base64Url.js +0 -89
- package/dist/encoding/Base64Url.js.map +0 -1
- package/dist/encoding/EncodingError.d.ts +0 -31
- package/dist/encoding/EncodingError.d.ts.map +0 -1
- package/dist/encoding/EncodingError.js +0 -22
- package/dist/encoding/EncodingError.js.map +0 -1
- package/dist/encoding/Hex.d.ts +0 -61
- package/dist/encoding/Hex.d.ts.map +0 -1
- package/dist/encoding/Hex.js +0 -115
- package/dist/encoding/Hex.js.map +0 -1
- package/dist/encoding/index.d.ts +0 -26
- package/dist/encoding/index.d.ts.map +0 -1
- package/dist/encoding/index.js +0 -27
- package/dist/encoding/index.js.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.d.ts +0 -7
- package/dist/unstable/cli/internal/builtInFlags.d.ts.map +0 -1
- package/dist/unstable/cli/internal/builtInFlags.js +0 -44
- package/dist/unstable/cli/internal/builtInFlags.js.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/Completions.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.js +0 -23
- package/dist/unstable/cli/internal/completions/Completions.js.map +0 -1
- package/src/PartitionedSemaphore.ts +0 -182
- package/src/encoding/Base64.ts +0 -366
- package/src/encoding/Base64Url.ts +0 -104
- package/src/encoding/EncodingError.ts +0 -35
- package/src/encoding/Hex.ts +0 -390
- package/src/encoding/index.ts +0 -31
- package/src/unstable/cli/internal/builtInFlags.ts +0 -78
- package/src/unstable/cli/internal/completions/Completions.ts +0 -31
package/dist/Schedule.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare const TypeId = "~effect/Schedule";
|
|
|
31
31
|
* const program = Effect.gen(function*() {
|
|
32
32
|
* // Using retry schedule
|
|
33
33
|
* const result1 = yield* Effect.retry(
|
|
34
|
-
* Effect.fail("temporary error"),
|
|
34
|
+
* Effect.suspend(() => Math.random() > 0.5 ? Effect.fail("temporary error") : Effect.succeed("Success")),
|
|
35
35
|
* retrySchedule
|
|
36
36
|
* )
|
|
37
37
|
*
|
|
@@ -143,7 +143,7 @@ export declare const CurrentMetadata: ServiceMap.Reference<Metadata<unknown, unk
|
|
|
143
143
|
* Effect.gen(function*() {
|
|
144
144
|
* attempt++
|
|
145
145
|
* if (attempt < 3) {
|
|
146
|
-
* yield* Effect.fail(`Attempt ${attempt} failed`)
|
|
146
|
+
* return yield* Effect.fail(`Attempt ${attempt} failed`)
|
|
147
147
|
* }
|
|
148
148
|
* return `Success on attempt ${attempt}`
|
|
149
149
|
* }),
|
|
@@ -272,7 +272,7 @@ export declare const isSchedule: (u: unknown) => u is Schedule<unknown, never, u
|
|
|
272
272
|
* @since 4.0.0
|
|
273
273
|
* @category constructors
|
|
274
274
|
*/
|
|
275
|
-
export declare const fromStep: <Input, Output, EnvX, Error, ErrorX, Env>(step: Effect<(now: number, input: Input) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, Error, Env>) => Schedule<Output, Input, Error | ErrorX
|
|
275
|
+
export declare const fromStep: <Input, Output, EnvX, Error, ErrorX, Env>(step: Effect<(now: number, input: Input) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, Error, Env>) => Schedule<Output, Input, Error | Pull.ExcludeDone<ErrorX>, Env | EnvX>;
|
|
276
276
|
/**
|
|
277
277
|
* Creates a Schedule from a step function that receives metadata about the schedule's execution.
|
|
278
278
|
*
|
|
@@ -297,7 +297,7 @@ export declare const fromStep: <Input, Output, EnvX, Error, ErrorX, Env>(step: E
|
|
|
297
297
|
* @since 4.0.0
|
|
298
298
|
* @category constructors
|
|
299
299
|
*/
|
|
300
|
-
export declare const fromStepWithMetadata: <Input, Output, EnvX, ErrorX, Error, Env>(step: Effect<(options: InputMetadata<Input>) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, Error, Env>) => Schedule<Output, Input, Error | ErrorX
|
|
300
|
+
export declare const fromStepWithMetadata: <Input, Output, EnvX, ErrorX, Error, Env>(step: Effect<(options: InputMetadata<Input>) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, Error, Env>) => Schedule<Output, Input, Error | Pull.ExcludeDone<ErrorX>, Env | EnvX>;
|
|
301
301
|
/**
|
|
302
302
|
* Extracts the step function from a Schedule.
|
|
303
303
|
*
|
|
@@ -367,7 +367,9 @@ export declare const toStepWithSleep: <Output, Input, Error, Env>(schedule: Sche
|
|
|
367
367
|
*
|
|
368
368
|
* @example
|
|
369
369
|
* ```ts
|
|
370
|
-
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
370
|
+
* import { Console, Data, Duration, Effect, Schedule } from "effect"
|
|
371
|
+
*
|
|
372
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
371
373
|
*
|
|
372
374
|
* // Add random jitter to schedule delays
|
|
373
375
|
* const jitteredSchedule = Schedule.addDelay(
|
|
@@ -463,7 +465,7 @@ export declare const toStepWithSleep: <Output, Input, Error, Env>(schedule: Sche
|
|
|
463
465
|
* Effect.gen(function*() {
|
|
464
466
|
* attempt++
|
|
465
467
|
* if (attempt < 5) {
|
|
466
|
-
* yield* Effect.fail(new
|
|
468
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
467
469
|
* }
|
|
468
470
|
* return `Success on attempt ${attempt}`
|
|
469
471
|
* }),
|
|
@@ -484,7 +486,9 @@ export declare const addDelay: {
|
|
|
484
486
|
*
|
|
485
487
|
* @example
|
|
486
488
|
* ```ts
|
|
487
|
-
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
489
|
+
* import { Console, Data, Duration, Effect, Schedule } from "effect"
|
|
490
|
+
*
|
|
491
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
488
492
|
*
|
|
489
493
|
* // Add random jitter to schedule delays
|
|
490
494
|
* const jitteredSchedule = Schedule.addDelay(
|
|
@@ -580,7 +584,7 @@ export declare const addDelay: {
|
|
|
580
584
|
* Effect.gen(function*() {
|
|
581
585
|
* attempt++
|
|
582
586
|
* if (attempt < 5) {
|
|
583
|
-
* yield* Effect.fail(new
|
|
587
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
584
588
|
* }
|
|
585
589
|
* return `Success on attempt ${attempt}`
|
|
586
590
|
* }),
|
|
@@ -594,14 +598,16 @@ export declare const addDelay: {
|
|
|
594
598
|
* @since 2.0.0
|
|
595
599
|
* @category utils
|
|
596
600
|
*/
|
|
597
|
-
<Output, Error2 = never, Env2 = never>(f: (output: Output) => Effect<Duration.
|
|
601
|
+
<Output, Error2 = never, Env2 = never>(f: (output: Output) => Effect<Duration.Input, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
598
602
|
/**
|
|
599
603
|
* Returns a new `Schedule` that adds the delay computed by the specified
|
|
600
604
|
* effectful function to the the next recurrence of the schedule.
|
|
601
605
|
*
|
|
602
606
|
* @example
|
|
603
607
|
* ```ts
|
|
604
|
-
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
608
|
+
* import { Console, Data, Duration, Effect, Schedule } from "effect"
|
|
609
|
+
*
|
|
610
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
605
611
|
*
|
|
606
612
|
* // Add random jitter to schedule delays
|
|
607
613
|
* const jitteredSchedule = Schedule.addDelay(
|
|
@@ -697,7 +703,7 @@ export declare const addDelay: {
|
|
|
697
703
|
* Effect.gen(function*() {
|
|
698
704
|
* attempt++
|
|
699
705
|
* if (attempt < 5) {
|
|
700
|
-
* yield* Effect.fail(new
|
|
706
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
701
707
|
* }
|
|
702
708
|
* return `Success on attempt ${attempt}`
|
|
703
709
|
* }),
|
|
@@ -711,7 +717,7 @@ export declare const addDelay: {
|
|
|
711
717
|
* @since 2.0.0
|
|
712
718
|
* @category utils
|
|
713
719
|
*/
|
|
714
|
-
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output) => Effect<Duration.
|
|
720
|
+
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output) => Effect<Duration.Input, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
715
721
|
};
|
|
716
722
|
/**
|
|
717
723
|
* Returns a new `Schedule` that will first execute the left (i.e. `self`)
|
|
@@ -720,7 +726,9 @@ export declare const addDelay: {
|
|
|
720
726
|
*
|
|
721
727
|
* @example
|
|
722
728
|
* ```ts
|
|
723
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
729
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
730
|
+
*
|
|
731
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
724
732
|
*
|
|
725
733
|
* // First retry 3 times quickly, then switch to slower retries
|
|
726
734
|
* const quickRetries = Schedule.exponential("100 millis").pipe(
|
|
@@ -739,7 +747,7 @@ export declare const addDelay: {
|
|
|
739
747
|
* attempt++
|
|
740
748
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
741
749
|
* if (attempt < 6) {
|
|
742
|
-
* yield* Effect.fail(new
|
|
750
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Failure ${attempt}` }))
|
|
743
751
|
* }
|
|
744
752
|
* return `Success on attempt ${attempt}`
|
|
745
753
|
* }),
|
|
@@ -759,7 +767,9 @@ export declare const andThen: {
|
|
|
759
767
|
*
|
|
760
768
|
* @example
|
|
761
769
|
* ```ts
|
|
762
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
770
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
771
|
+
*
|
|
772
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
763
773
|
*
|
|
764
774
|
* // First retry 3 times quickly, then switch to slower retries
|
|
765
775
|
* const quickRetries = Schedule.exponential("100 millis").pipe(
|
|
@@ -778,7 +788,7 @@ export declare const andThen: {
|
|
|
778
788
|
* attempt++
|
|
779
789
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
780
790
|
* if (attempt < 6) {
|
|
781
|
-
* yield* Effect.fail(new
|
|
791
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Failure ${attempt}` }))
|
|
782
792
|
* }
|
|
783
793
|
* return `Success on attempt ${attempt}`
|
|
784
794
|
* }),
|
|
@@ -798,7 +808,9 @@ export declare const andThen: {
|
|
|
798
808
|
*
|
|
799
809
|
* @example
|
|
800
810
|
* ```ts
|
|
801
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
811
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
812
|
+
*
|
|
813
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
802
814
|
*
|
|
803
815
|
* // First retry 3 times quickly, then switch to slower retries
|
|
804
816
|
* const quickRetries = Schedule.exponential("100 millis").pipe(
|
|
@@ -817,7 +829,7 @@ export declare const andThen: {
|
|
|
817
829
|
* attempt++
|
|
818
830
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
819
831
|
* if (attempt < 6) {
|
|
820
|
-
* yield* Effect.fail(new
|
|
832
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Failure ${attempt}` }))
|
|
821
833
|
* }
|
|
822
834
|
* return `Success on attempt ${attempt}`
|
|
823
835
|
* }),
|
|
@@ -962,7 +974,9 @@ export declare const andThenResult: {
|
|
|
962
974
|
*
|
|
963
975
|
* @example
|
|
964
976
|
* ```ts
|
|
965
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
977
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
978
|
+
*
|
|
979
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
966
980
|
*
|
|
967
981
|
* // Both schedules must want to continue for the combined schedule to continue
|
|
968
982
|
* const timeLimit = Schedule.spaced("1 second").pipe(Schedule.take(5)) // max 5 times
|
|
@@ -1004,7 +1018,7 @@ export declare const andThenResult: {
|
|
|
1004
1018
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
1005
1019
|
*
|
|
1006
1020
|
* if (attempt < 3) {
|
|
1007
|
-
* yield* Effect.fail(new
|
|
1021
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1008
1022
|
* }
|
|
1009
1023
|
*
|
|
1010
1024
|
* return `Success on attempt ${attempt}`
|
|
@@ -1030,7 +1044,9 @@ export declare const both: {
|
|
|
1030
1044
|
*
|
|
1031
1045
|
* @example
|
|
1032
1046
|
* ```ts
|
|
1033
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1047
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1048
|
+
*
|
|
1049
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1034
1050
|
*
|
|
1035
1051
|
* // Both schedules must want to continue for the combined schedule to continue
|
|
1036
1052
|
* const timeLimit = Schedule.spaced("1 second").pipe(Schedule.take(5)) // max 5 times
|
|
@@ -1072,7 +1088,7 @@ export declare const both: {
|
|
|
1072
1088
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
1073
1089
|
*
|
|
1074
1090
|
* if (attempt < 3) {
|
|
1075
|
-
* yield* Effect.fail(new
|
|
1091
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1076
1092
|
* }
|
|
1077
1093
|
*
|
|
1078
1094
|
* return `Success on attempt ${attempt}`
|
|
@@ -1098,7 +1114,9 @@ export declare const both: {
|
|
|
1098
1114
|
*
|
|
1099
1115
|
* @example
|
|
1100
1116
|
* ```ts
|
|
1101
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1117
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1118
|
+
*
|
|
1119
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1102
1120
|
*
|
|
1103
1121
|
* // Both schedules must want to continue for the combined schedule to continue
|
|
1104
1122
|
* const timeLimit = Schedule.spaced("1 second").pipe(Schedule.take(5)) // max 5 times
|
|
@@ -1140,7 +1158,7 @@ export declare const both: {
|
|
|
1140
1158
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
1141
1159
|
*
|
|
1142
1160
|
* if (attempt < 3) {
|
|
1143
|
-
* yield* Effect.fail(new
|
|
1161
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1144
1162
|
* }
|
|
1145
1163
|
*
|
|
1146
1164
|
* return `Success on attempt ${attempt}`
|
|
@@ -1485,7 +1503,9 @@ export declare const bothWith: {
|
|
|
1485
1503
|
*
|
|
1486
1504
|
* @example
|
|
1487
1505
|
* ```ts
|
|
1488
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1506
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1507
|
+
*
|
|
1508
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1489
1509
|
*
|
|
1490
1510
|
* // Compose a quick retry phase followed by slower retry phase
|
|
1491
1511
|
* const fastRetries = Schedule.exponential("100 millis").pipe(
|
|
@@ -1509,7 +1529,7 @@ export declare const bothWith: {
|
|
|
1509
1529
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
1510
1530
|
*
|
|
1511
1531
|
* if (attempt < 7) { // Needs both phases to succeed
|
|
1512
|
-
* yield* Effect.fail(new
|
|
1532
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1513
1533
|
* }
|
|
1514
1534
|
*
|
|
1515
1535
|
* return `Success on attempt ${attempt}`
|
|
@@ -1548,7 +1568,9 @@ export declare const compose: {
|
|
|
1548
1568
|
*
|
|
1549
1569
|
* @example
|
|
1550
1570
|
* ```ts
|
|
1551
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1571
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1572
|
+
*
|
|
1573
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1552
1574
|
*
|
|
1553
1575
|
* // Compose a quick retry phase followed by slower retry phase
|
|
1554
1576
|
* const fastRetries = Schedule.exponential("100 millis").pipe(
|
|
@@ -1572,7 +1594,7 @@ export declare const compose: {
|
|
|
1572
1594
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
1573
1595
|
*
|
|
1574
1596
|
* if (attempt < 7) { // Needs both phases to succeed
|
|
1575
|
-
* yield* Effect.fail(new
|
|
1597
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1576
1598
|
* }
|
|
1577
1599
|
*
|
|
1578
1600
|
* return `Success on attempt ${attempt}`
|
|
@@ -1611,7 +1633,9 @@ export declare const compose: {
|
|
|
1611
1633
|
*
|
|
1612
1634
|
* @example
|
|
1613
1635
|
* ```ts
|
|
1614
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
1636
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1637
|
+
*
|
|
1638
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
1615
1639
|
*
|
|
1616
1640
|
* // Compose a quick retry phase followed by slower retry phase
|
|
1617
1641
|
* const fastRetries = Schedule.exponential("100 millis").pipe(
|
|
@@ -1635,7 +1659,7 @@ export declare const compose: {
|
|
|
1635
1659
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
1636
1660
|
*
|
|
1637
1661
|
* if (attempt < 7) { // Needs both phases to succeed
|
|
1638
|
-
* yield* Effect.fail(new
|
|
1662
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
1639
1663
|
* }
|
|
1640
1664
|
*
|
|
1641
1665
|
* return `Success on attempt ${attempt}`
|
|
@@ -1935,7 +1959,7 @@ export declare const collectWhile: {
|
|
|
1935
1959
|
* @since 2.0.0
|
|
1936
1960
|
* @category utilities
|
|
1937
1961
|
*/
|
|
1938
|
-
<Input, Output, Error2 = never, Env2 = never>(predicate: (metadata: Metadata<Output, Input>) => Effect<boolean, Error2, Env2>): <Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Array<Output>, Input, Error | Error2, Env | Env2>;
|
|
1962
|
+
<Input, Output, Error2 = never, Env2 = never>(predicate: (metadata: Metadata<Output, Input>) => boolean | Effect<boolean, Error2, Env2>): <Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Array<Output>, Input, Error | Error2, Env | Env2>;
|
|
1939
1963
|
/**
|
|
1940
1964
|
* Returns a new `Schedule` that recurs as long as the specified `predicate`
|
|
1941
1965
|
* returns `true`, collecting all outputs of the schedule into an array.
|
|
@@ -2040,7 +2064,7 @@ export declare const collectWhile: {
|
|
|
2040
2064
|
* @since 2.0.0
|
|
2041
2065
|
* @category utilities
|
|
2042
2066
|
*/
|
|
2043
|
-
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, predicate: (metadata: Metadata<Output, Input>) => Effect<boolean, Error2, Env2>): Schedule<Array<Output>, Input, Error | Error2, Env | Env2>;
|
|
2067
|
+
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, predicate: (metadata: Metadata<Output, Input>) => boolean | Effect<boolean, Error2, Env2>): Schedule<Array<Output>, Input, Error | Error2, Env | Env2>;
|
|
2044
2068
|
};
|
|
2045
2069
|
/**
|
|
2046
2070
|
* Returns a new `Schedule` that recurs on the specified `Cron` schedule and
|
|
@@ -2048,7 +2072,9 @@ export declare const collectWhile: {
|
|
|
2048
2072
|
*
|
|
2049
2073
|
* @example
|
|
2050
2074
|
* ```ts
|
|
2051
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2075
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2076
|
+
*
|
|
2077
|
+
* class ScheduledTaskError extends Data.TaggedError("ScheduledTaskError")<{ readonly message: string }> {}
|
|
2052
2078
|
*
|
|
2053
2079
|
* // Run every minute
|
|
2054
2080
|
* const everyMinute = Schedule.cron("* * * * *")
|
|
@@ -2149,7 +2175,7 @@ export declare const collectWhile: {
|
|
|
2149
2175
|
* yield* Console.log("Complex scheduled task...")
|
|
2150
2176
|
* // Simulate occasional failures
|
|
2151
2177
|
* if (Math.random() < 0.3) {
|
|
2152
|
-
* yield* Effect.fail(new
|
|
2178
|
+
* return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
|
|
2153
2179
|
* }
|
|
2154
2180
|
* return "success"
|
|
2155
2181
|
* }),
|
|
@@ -2172,7 +2198,9 @@ export declare const cron: {
|
|
|
2172
2198
|
*
|
|
2173
2199
|
* @example
|
|
2174
2200
|
* ```ts
|
|
2175
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2201
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2202
|
+
*
|
|
2203
|
+
* class ScheduledTaskError extends Data.TaggedError("ScheduledTaskError")<{ readonly message: string }> {}
|
|
2176
2204
|
*
|
|
2177
2205
|
* // Run every minute
|
|
2178
2206
|
* const everyMinute = Schedule.cron("* * * * *")
|
|
@@ -2273,7 +2301,7 @@ export declare const cron: {
|
|
|
2273
2301
|
* yield* Console.log("Complex scheduled task...")
|
|
2274
2302
|
* // Simulate occasional failures
|
|
2275
2303
|
* if (Math.random() < 0.3) {
|
|
2276
|
-
* yield* Effect.fail(new
|
|
2304
|
+
* return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
|
|
2277
2305
|
* }
|
|
2278
2306
|
* return "success"
|
|
2279
2307
|
* }),
|
|
@@ -2296,7 +2324,9 @@ export declare const cron: {
|
|
|
2296
2324
|
*
|
|
2297
2325
|
* @example
|
|
2298
2326
|
* ```ts
|
|
2299
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2327
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2328
|
+
*
|
|
2329
|
+
* class ScheduledTaskError extends Data.TaggedError("ScheduledTaskError")<{ readonly message: string }> {}
|
|
2300
2330
|
*
|
|
2301
2331
|
* // Run every minute
|
|
2302
2332
|
* const everyMinute = Schedule.cron("* * * * *")
|
|
@@ -2397,7 +2427,7 @@ export declare const cron: {
|
|
|
2397
2427
|
* yield* Console.log("Complex scheduled task...")
|
|
2398
2428
|
* // Simulate occasional failures
|
|
2399
2429
|
* if (Math.random() < 0.3) {
|
|
2400
|
-
* yield* Effect.fail(new
|
|
2430
|
+
* return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
|
|
2401
2431
|
* }
|
|
2402
2432
|
* return "success"
|
|
2403
2433
|
* }),
|
|
@@ -2499,13 +2529,25 @@ export declare const cron: {
|
|
|
2499
2529
|
* @category constructors
|
|
2500
2530
|
*/
|
|
2501
2531
|
export declare const delays: <Out, In, E, R>(self: Schedule<Out, In, E, R>) => Schedule<Duration.Duration, In, E, R>;
|
|
2532
|
+
/**
|
|
2533
|
+
* Returns a schedule that recurs once after the specified duration.
|
|
2534
|
+
*
|
|
2535
|
+
* The schedule outputs the configured duration for its first recurrence and
|
|
2536
|
+
* then completes.
|
|
2537
|
+
*
|
|
2538
|
+
* @since 2.0.0
|
|
2539
|
+
* @category constructors
|
|
2540
|
+
*/
|
|
2541
|
+
export declare const duration: (durationInput: Duration.Input) => Schedule<Duration.Duration>;
|
|
2502
2542
|
/**
|
|
2503
2543
|
* Returns a new `Schedule` that will always recur, but only during the
|
|
2504
2544
|
* specified `duration` of time.
|
|
2505
2545
|
*
|
|
2506
2546
|
* @example
|
|
2507
2547
|
* ```ts
|
|
2508
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2548
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2549
|
+
*
|
|
2550
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
2509
2551
|
*
|
|
2510
2552
|
* // Run a task for exactly 5 seconds, regardless of how many iterations
|
|
2511
2553
|
* const fiveSecondSchedule = Schedule.during("5 seconds")
|
|
@@ -2567,7 +2609,7 @@ export declare const delays: <Out, In, E, R>(self: Schedule<Out, In, E, R>) => S
|
|
|
2567
2609
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2568
2610
|
*
|
|
2569
2611
|
* if (Math.random() < 0.8) { // 80% failure rate
|
|
2570
|
-
* yield* Effect.fail(new
|
|
2612
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
2571
2613
|
* }
|
|
2572
2614
|
*
|
|
2573
2615
|
* return `Success on attempt ${attempt}`
|
|
@@ -2584,7 +2626,7 @@ export declare const delays: <Out, In, E, R>(self: Schedule<Out, In, E, R>) => S
|
|
|
2584
2626
|
* @since 4.0.0
|
|
2585
2627
|
* @category constructors
|
|
2586
2628
|
*/
|
|
2587
|
-
export declare const during: (duration: Duration.
|
|
2629
|
+
export declare const during: (duration: Duration.Input) => Schedule<Duration.Duration>;
|
|
2588
2630
|
/**
|
|
2589
2631
|
* Combines two `Schedule`s by recurring if either of the two schedules wants
|
|
2590
2632
|
* to recur, using the minimum of the two durations between recurrences and
|
|
@@ -2592,7 +2634,9 @@ export declare const during: (duration: Duration.DurationInput) => Schedule<Dura
|
|
|
2592
2634
|
*
|
|
2593
2635
|
* @example
|
|
2594
2636
|
* ```ts
|
|
2595
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2637
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2638
|
+
*
|
|
2639
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
2596
2640
|
*
|
|
2597
2641
|
* // Either continues as long as at least one schedule wants to continue
|
|
2598
2642
|
* const timeBasedSchedule = Schedule.spaced("2 seconds").pipe(Schedule.take(3))
|
|
@@ -2636,7 +2680,7 @@ export declare const during: (duration: Duration.DurationInput) => Schedule<Dura
|
|
|
2636
2680
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2637
2681
|
*
|
|
2638
2682
|
* if (attempt < 6) {
|
|
2639
|
-
* yield* Effect.fail(new
|
|
2683
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
2640
2684
|
* }
|
|
2641
2685
|
*
|
|
2642
2686
|
* return `Success on attempt ${attempt}`
|
|
@@ -2662,7 +2706,9 @@ export declare const either: {
|
|
|
2662
2706
|
*
|
|
2663
2707
|
* @example
|
|
2664
2708
|
* ```ts
|
|
2665
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2709
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2710
|
+
*
|
|
2711
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
2666
2712
|
*
|
|
2667
2713
|
* // Either continues as long as at least one schedule wants to continue
|
|
2668
2714
|
* const timeBasedSchedule = Schedule.spaced("2 seconds").pipe(Schedule.take(3))
|
|
@@ -2706,7 +2752,7 @@ export declare const either: {
|
|
|
2706
2752
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2707
2753
|
*
|
|
2708
2754
|
* if (attempt < 6) {
|
|
2709
|
-
* yield* Effect.fail(new
|
|
2755
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
2710
2756
|
* }
|
|
2711
2757
|
*
|
|
2712
2758
|
* return `Success on attempt ${attempt}`
|
|
@@ -2732,7 +2778,9 @@ export declare const either: {
|
|
|
2732
2778
|
*
|
|
2733
2779
|
* @example
|
|
2734
2780
|
* ```ts
|
|
2735
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
2781
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2782
|
+
*
|
|
2783
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
2736
2784
|
*
|
|
2737
2785
|
* // Either continues as long as at least one schedule wants to continue
|
|
2738
2786
|
* const timeBasedSchedule = Schedule.spaced("2 seconds").pipe(Schedule.take(3))
|
|
@@ -2776,7 +2824,7 @@ export declare const either: {
|
|
|
2776
2824
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2777
2825
|
*
|
|
2778
2826
|
* if (attempt < 6) {
|
|
2779
|
-
* yield* Effect.fail(new
|
|
2827
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
2780
2828
|
* }
|
|
2781
2829
|
*
|
|
2782
2830
|
* return `Success on attempt ${attempt}`
|
|
@@ -3166,7 +3214,9 @@ export declare const elapsed: Schedule<Duration.Duration>;
|
|
|
3166
3214
|
*
|
|
3167
3215
|
* @example
|
|
3168
3216
|
* ```ts
|
|
3169
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
3217
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
3218
|
+
*
|
|
3219
|
+
* class RetryFailure extends Data.TaggedError("RetryFailure")<{ readonly message: string }> {}
|
|
3170
3220
|
*
|
|
3171
3221
|
* // Basic exponential backoff with default factor of 2
|
|
3172
3222
|
* const basicExponential = Schedule.exponential("100 millis")
|
|
@@ -3189,7 +3239,7 @@ export declare const elapsed: Schedule<Duration.Duration>;
|
|
|
3189
3239
|
* attempt++
|
|
3190
3240
|
* if (attempt < 4) {
|
|
3191
3241
|
* yield* Console.log(`Attempt ${attempt} failed, retrying...`)
|
|
3192
|
-
* yield* Effect.fail(new
|
|
3242
|
+
* return yield* Effect.fail(new RetryFailure({ message: `Failure ${attempt}` }))
|
|
3193
3243
|
* }
|
|
3194
3244
|
* return `Success on attempt ${attempt}`
|
|
3195
3245
|
* }),
|
|
@@ -3205,7 +3255,7 @@ export declare const elapsed: Schedule<Duration.Duration>;
|
|
|
3205
3255
|
* @since 2.0.0
|
|
3206
3256
|
* @category constructors
|
|
3207
3257
|
*/
|
|
3208
|
-
export declare const exponential: (base: Duration.
|
|
3258
|
+
export declare const exponential: (base: Duration.Input, factor?: number) => Schedule<Duration.Duration>;
|
|
3209
3259
|
/**
|
|
3210
3260
|
* A schedule that always recurs, increasing delays by summing the preceding
|
|
3211
3261
|
* two delays (similar to the fibonacci sequence). Returns the current
|
|
@@ -3213,7 +3263,9 @@ export declare const exponential: (base: Duration.DurationInput, factor?: number
|
|
|
3213
3263
|
*
|
|
3214
3264
|
* @example
|
|
3215
3265
|
* ```ts
|
|
3216
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
3266
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
3267
|
+
*
|
|
3268
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
3217
3269
|
*
|
|
3218
3270
|
* // Basic fibonacci schedule starting with 100ms
|
|
3219
3271
|
* const fibSchedule = Schedule.fibonacci("100 millis")
|
|
@@ -3229,7 +3281,7 @@ export declare const exponential: (base: Duration.DurationInput, factor?: number
|
|
|
3229
3281
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
3230
3282
|
*
|
|
3231
3283
|
* if (attempt < 5) {
|
|
3232
|
-
* yield* Effect.fail(new
|
|
3284
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
3233
3285
|
* }
|
|
3234
3286
|
*
|
|
3235
3287
|
* return `Success on attempt ${attempt}`
|
|
@@ -3270,7 +3322,7 @@ export declare const exponential: (base: Duration.DurationInput, factor?: number
|
|
|
3270
3322
|
* @since 2.0.0
|
|
3271
3323
|
* @category constructors
|
|
3272
3324
|
*/
|
|
3273
|
-
export declare const fibonacci: (one: Duration.
|
|
3325
|
+
export declare const fibonacci: (one: Duration.Input) => Schedule<Duration.Duration>;
|
|
3274
3326
|
/**
|
|
3275
3327
|
* Returns a `Schedule` that recurs on the specified fixed `interval` and
|
|
3276
3328
|
* outputs the number of repetitions of the schedule so far.
|
|
@@ -3333,7 +3385,7 @@ export declare const fibonacci: (one: Duration.DurationInput) => Schedule<Durati
|
|
|
3333
3385
|
* @since 2.0.0
|
|
3334
3386
|
* @category constructors
|
|
3335
3387
|
*/
|
|
3336
|
-
export declare const fixed: (interval: Duration.
|
|
3388
|
+
export declare const fixed: (interval: Duration.Input) => Schedule<number>;
|
|
3337
3389
|
/**
|
|
3338
3390
|
* Returns a new `Schedule` that maps the output of this schedule using the
|
|
3339
3391
|
* specified function.
|
|
@@ -3459,7 +3511,7 @@ export declare const map: {
|
|
|
3459
3511
|
* @since 2.0.0
|
|
3460
3512
|
* @category mapping
|
|
3461
3513
|
*/
|
|
3462
|
-
<Output, Output2, Error2 = never, Env2 = never>(f: (output: Output) => Effect<Output2, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output2, Input, Error | Error2, Env | Env2>;
|
|
3514
|
+
<Output, Output2, Error2 = never, Env2 = never>(f: (output: Output) => Output2 | Effect<Output2, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output2, Input, Error | Error2, Env | Env2>;
|
|
3463
3515
|
/**
|
|
3464
3516
|
* Returns a new `Schedule` that maps the output of this schedule using the
|
|
3465
3517
|
* specified function.
|
|
@@ -3522,7 +3574,7 @@ export declare const map: {
|
|
|
3522
3574
|
* @since 2.0.0
|
|
3523
3575
|
* @category mapping
|
|
3524
3576
|
*/
|
|
3525
|
-
<Output, Input, Error, Env, Output2, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output) => Effect<Output2, Error2, Env2>): Schedule<Output2, Input, Error | Error2, Env | Env2>;
|
|
3577
|
+
<Output, Input, Error, Env, Output2, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output) => Output2 | Effect<Output2, Error2, Env2>): Schedule<Output2, Input, Error | Error2, Env | Env2>;
|
|
3526
3578
|
};
|
|
3527
3579
|
/**
|
|
3528
3580
|
* Returns a new `Schedule` that modifies the delay of the next recurrence
|
|
@@ -3589,7 +3641,7 @@ export declare const modifyDelay: {
|
|
|
3589
3641
|
* @since 2.0.0
|
|
3590
3642
|
* @category utilities
|
|
3591
3643
|
*/
|
|
3592
|
-
<Output, Error2 = never, Env2 = never>(f: (output: Output, delay: Duration.Duration) => Effect<Duration.
|
|
3644
|
+
<Output, Error2 = never, Env2 = never>(f: (output: Output, delay: Duration.Duration) => Effect<Duration.Input, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
3593
3645
|
/**
|
|
3594
3646
|
* Returns a new `Schedule` that modifies the delay of the next recurrence
|
|
3595
3647
|
* of the schedule using the specified effectual function.
|
|
@@ -3622,8 +3674,17 @@ export declare const modifyDelay: {
|
|
|
3622
3674
|
* @since 2.0.0
|
|
3623
3675
|
* @category utilities
|
|
3624
3676
|
*/
|
|
3625
|
-
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output, delay: Duration.
|
|
3677
|
+
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, f: (output: Output, delay: Duration.Input) => Effect<Duration.Input, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
3626
3678
|
};
|
|
3679
|
+
/**
|
|
3680
|
+
* Returns a new `Schedule` that randomly adjusts each recurrence delay.
|
|
3681
|
+
*
|
|
3682
|
+
* Delays are jittered between `80%` and `120%` of the original delay.
|
|
3683
|
+
*
|
|
3684
|
+
* @since 2.0.0
|
|
3685
|
+
* @category utilities
|
|
3686
|
+
*/
|
|
3687
|
+
export declare const jittered: <Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
|
|
3627
3688
|
/**
|
|
3628
3689
|
* Returns a new `Schedule` that outputs the inputs of the specified schedule.
|
|
3629
3690
|
*
|
|
@@ -3659,7 +3720,9 @@ export declare const passthrough: <Output, Input, Error, Env>(self: Schedule<Out
|
|
|
3659
3720
|
*
|
|
3660
3721
|
* @example
|
|
3661
3722
|
* ```ts
|
|
3662
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
3723
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
3724
|
+
*
|
|
3725
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
3663
3726
|
*
|
|
3664
3727
|
* // Basic recurs - retry at most 3 times
|
|
3665
3728
|
* const maxThreeAttempts = Schedule.recurs(3)
|
|
@@ -3674,7 +3737,7 @@ export declare const passthrough: <Output, Input, Error, Env>(self: Schedule<Out
|
|
|
3674
3737
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
3675
3738
|
*
|
|
3676
3739
|
* if (attempt < 4) {
|
|
3677
|
-
* yield* Effect.fail(new
|
|
3740
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
3678
3741
|
* }
|
|
3679
3742
|
*
|
|
3680
3743
|
* return `Success on attempt ${attempt}`
|
|
@@ -3931,7 +3994,7 @@ export declare const reduce: {
|
|
|
3931
3994
|
* @since 2.0.0
|
|
3932
3995
|
* @category utilities
|
|
3933
3996
|
*/
|
|
3934
|
-
<State, Output, Error2 = never, Env2 = never>(initial: LazyArg<State>, combine: (state: State, output: Output) => Effect<State, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<State, Input, Error | Error2, Env | Env2>;
|
|
3997
|
+
<State, Output, Error2 = never, Env2 = never>(initial: LazyArg<State>, combine: (state: State, output: Output) => State | Effect<State, Error2, Env2>): <Input, Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<State, Input, Error | Error2, Env | Env2>;
|
|
3935
3998
|
/**
|
|
3936
3999
|
* Returns a new `Schedule` that combines the outputs of the provided schedule
|
|
3937
4000
|
* using the specified effectful `combine` function and starting from the
|
|
@@ -4043,7 +4106,7 @@ export declare const reduce: {
|
|
|
4043
4106
|
* @since 2.0.0
|
|
4044
4107
|
* @category utilities
|
|
4045
4108
|
*/
|
|
4046
|
-
<Output, Input, Error, Env, State, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, initial: LazyArg<State>, combine: (state: State, output: Output) => Effect<State, Error2, Env2>): Schedule<State, Input, Error | Error2, Env | Env2>;
|
|
4109
|
+
<Output, Input, Error, Env, State, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, initial: LazyArg<State>, combine: (state: State, output: Output) => State | Effect<State, Error2, Env2>): Schedule<State, Input, Error | Error2, Env | Env2>;
|
|
4047
4110
|
};
|
|
4048
4111
|
/**
|
|
4049
4112
|
* Returns a schedule that recurs continuously, each repetition spaced the
|
|
@@ -4094,7 +4157,7 @@ export declare const reduce: {
|
|
|
4094
4157
|
* @since 2.0.0
|
|
4095
4158
|
* @category constructors
|
|
4096
4159
|
*/
|
|
4097
|
-
export declare const spaced: (duration: Duration.
|
|
4160
|
+
export declare const spaced: (duration: Duration.Input) => Schedule<number>;
|
|
4098
4161
|
/**
|
|
4099
4162
|
* Returns a new `Schedule` that allows execution of an effectful function for
|
|
4100
4163
|
* every input to the schedule, but does not alter the inputs and outputs of
|
|
@@ -4102,12 +4165,14 @@ export declare const spaced: (duration: Duration.DurationInput) => Schedule<numb
|
|
|
4102
4165
|
*
|
|
4103
4166
|
* @example
|
|
4104
4167
|
* ```ts
|
|
4105
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4168
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4169
|
+
*
|
|
4170
|
+
* class RetryError extends Data.TaggedError("RetryError")<{ readonly message: string }> {}
|
|
4106
4171
|
*
|
|
4107
4172
|
* // Log retry errors for debugging
|
|
4108
4173
|
* const errorLoggingSchedule = Schedule.exponential("100 millis").pipe(
|
|
4109
4174
|
* Schedule.take(3),
|
|
4110
|
-
* Schedule.tapInput((error:
|
|
4175
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4111
4176
|
* Console.log(`Retry triggered by error: ${String(error)}`)
|
|
4112
4177
|
* )
|
|
4113
4178
|
* )
|
|
@@ -4119,7 +4184,7 @@ export declare const spaced: (duration: Duration.DurationInput) => Schedule<numb
|
|
|
4119
4184
|
* Effect.gen(function*() {
|
|
4120
4185
|
* attempt++
|
|
4121
4186
|
* if (attempt < 4) {
|
|
4122
|
-
* yield* Effect.fail(new
|
|
4187
|
+
* return yield* Effect.fail(new RetryError({ message: `Network timeout on attempt ${attempt}` }))
|
|
4123
4188
|
* }
|
|
4124
4189
|
* return `Success on attempt ${attempt}`
|
|
4125
4190
|
* }),
|
|
@@ -4168,7 +4233,7 @@ export declare const spaced: (duration: Duration.DurationInput) => Schedule<numb
|
|
|
4168
4233
|
* // Conditional alerting based on input
|
|
4169
4234
|
* const alertingSchedule = Schedule.exponential("200 millis").pipe(
|
|
4170
4235
|
* Schedule.take(6),
|
|
4171
|
-
* Schedule.tapInput((error:
|
|
4236
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4172
4237
|
* Effect.gen(function*() {
|
|
4173
4238
|
* if (String(error).includes("critical")) {
|
|
4174
4239
|
* yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
|
|
@@ -4190,7 +4255,7 @@ export declare const spaced: (duration: Duration.DurationInput) => Schedule<numb
|
|
|
4190
4255
|
* const errorType = isCritical
|
|
4191
4256
|
* ? "critical database failure"
|
|
4192
4257
|
* : "temporary network issue"
|
|
4193
|
-
* yield* Effect.fail(new
|
|
4258
|
+
* return yield* Effect.fail(new RetryError({ message: errorType }))
|
|
4194
4259
|
* }),
|
|
4195
4260
|
* alertingSchedule
|
|
4196
4261
|
* ).pipe(
|
|
@@ -4203,10 +4268,10 @@ export declare const spaced: (duration: Duration.DurationInput) => Schedule<numb
|
|
|
4203
4268
|
* // Chain multiple input taps for different purposes
|
|
4204
4269
|
* const comprehensiveSchedule = Schedule.fibonacci("100 millis").pipe(
|
|
4205
4270
|
* Schedule.take(5),
|
|
4206
|
-
* Schedule.tapInput((error:
|
|
4207
|
-
* Console.log(`Error occurred: ${error.
|
|
4271
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4272
|
+
* Console.log(`Error occurred: ${error._tag}`)
|
|
4208
4273
|
* ),
|
|
4209
|
-
* Schedule.tapInput((error:
|
|
4274
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4210
4275
|
* String(error).length > 20
|
|
4211
4276
|
* ? Console.log("📝 Long error message detected")
|
|
4212
4277
|
* : Effect.void
|
|
@@ -4225,12 +4290,14 @@ export declare const tapInput: {
|
|
|
4225
4290
|
*
|
|
4226
4291
|
* @example
|
|
4227
4292
|
* ```ts
|
|
4228
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4293
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4294
|
+
*
|
|
4295
|
+
* class RetryError extends Data.TaggedError("RetryError")<{ readonly message: string }> {}
|
|
4229
4296
|
*
|
|
4230
4297
|
* // Log retry errors for debugging
|
|
4231
4298
|
* const errorLoggingSchedule = Schedule.exponential("100 millis").pipe(
|
|
4232
4299
|
* Schedule.take(3),
|
|
4233
|
-
* Schedule.tapInput((error:
|
|
4300
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4234
4301
|
* Console.log(`Retry triggered by error: ${String(error)}`)
|
|
4235
4302
|
* )
|
|
4236
4303
|
* )
|
|
@@ -4242,7 +4309,7 @@ export declare const tapInput: {
|
|
|
4242
4309
|
* Effect.gen(function*() {
|
|
4243
4310
|
* attempt++
|
|
4244
4311
|
* if (attempt < 4) {
|
|
4245
|
-
* yield* Effect.fail(new
|
|
4312
|
+
* return yield* Effect.fail(new RetryError({ message: `Network timeout on attempt ${attempt}` }))
|
|
4246
4313
|
* }
|
|
4247
4314
|
* return `Success on attempt ${attempt}`
|
|
4248
4315
|
* }),
|
|
@@ -4291,7 +4358,7 @@ export declare const tapInput: {
|
|
|
4291
4358
|
* // Conditional alerting based on input
|
|
4292
4359
|
* const alertingSchedule = Schedule.exponential("200 millis").pipe(
|
|
4293
4360
|
* Schedule.take(6),
|
|
4294
|
-
* Schedule.tapInput((error:
|
|
4361
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4295
4362
|
* Effect.gen(function*() {
|
|
4296
4363
|
* if (String(error).includes("critical")) {
|
|
4297
4364
|
* yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
|
|
@@ -4313,7 +4380,7 @@ export declare const tapInput: {
|
|
|
4313
4380
|
* const errorType = isCritical
|
|
4314
4381
|
* ? "critical database failure"
|
|
4315
4382
|
* : "temporary network issue"
|
|
4316
|
-
* yield* Effect.fail(new
|
|
4383
|
+
* return yield* Effect.fail(new RetryError({ message: errorType }))
|
|
4317
4384
|
* }),
|
|
4318
4385
|
* alertingSchedule
|
|
4319
4386
|
* ).pipe(
|
|
@@ -4326,10 +4393,10 @@ export declare const tapInput: {
|
|
|
4326
4393
|
* // Chain multiple input taps for different purposes
|
|
4327
4394
|
* const comprehensiveSchedule = Schedule.fibonacci("100 millis").pipe(
|
|
4328
4395
|
* Schedule.take(5),
|
|
4329
|
-
* Schedule.tapInput((error:
|
|
4330
|
-
* Console.log(`Error occurred: ${error.
|
|
4396
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4397
|
+
* Console.log(`Error occurred: ${error._tag}`)
|
|
4331
4398
|
* ),
|
|
4332
|
-
* Schedule.tapInput((error:
|
|
4399
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4333
4400
|
* String(error).length > 20
|
|
4334
4401
|
* ? Console.log("📝 Long error message detected")
|
|
4335
4402
|
* : Effect.void
|
|
@@ -4348,12 +4415,14 @@ export declare const tapInput: {
|
|
|
4348
4415
|
*
|
|
4349
4416
|
* @example
|
|
4350
4417
|
* ```ts
|
|
4351
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4418
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4419
|
+
*
|
|
4420
|
+
* class RetryError extends Data.TaggedError("RetryError")<{ readonly message: string }> {}
|
|
4352
4421
|
*
|
|
4353
4422
|
* // Log retry errors for debugging
|
|
4354
4423
|
* const errorLoggingSchedule = Schedule.exponential("100 millis").pipe(
|
|
4355
4424
|
* Schedule.take(3),
|
|
4356
|
-
* Schedule.tapInput((error:
|
|
4425
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4357
4426
|
* Console.log(`Retry triggered by error: ${String(error)}`)
|
|
4358
4427
|
* )
|
|
4359
4428
|
* )
|
|
@@ -4365,7 +4434,7 @@ export declare const tapInput: {
|
|
|
4365
4434
|
* Effect.gen(function*() {
|
|
4366
4435
|
* attempt++
|
|
4367
4436
|
* if (attempt < 4) {
|
|
4368
|
-
* yield* Effect.fail(new
|
|
4437
|
+
* return yield* Effect.fail(new RetryError({ message: `Network timeout on attempt ${attempt}` }))
|
|
4369
4438
|
* }
|
|
4370
4439
|
* return `Success on attempt ${attempt}`
|
|
4371
4440
|
* }),
|
|
@@ -4414,7 +4483,7 @@ export declare const tapInput: {
|
|
|
4414
4483
|
* // Conditional alerting based on input
|
|
4415
4484
|
* const alertingSchedule = Schedule.exponential("200 millis").pipe(
|
|
4416
4485
|
* Schedule.take(6),
|
|
4417
|
-
* Schedule.tapInput((error:
|
|
4486
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4418
4487
|
* Effect.gen(function*() {
|
|
4419
4488
|
* if (String(error).includes("critical")) {
|
|
4420
4489
|
* yield* Console.log(`🚨 CRITICAL ERROR: ${String(error)}`)
|
|
@@ -4436,7 +4505,7 @@ export declare const tapInput: {
|
|
|
4436
4505
|
* const errorType = isCritical
|
|
4437
4506
|
* ? "critical database failure"
|
|
4438
4507
|
* : "temporary network issue"
|
|
4439
|
-
* yield* Effect.fail(new
|
|
4508
|
+
* return yield* Effect.fail(new RetryError({ message: errorType }))
|
|
4440
4509
|
* }),
|
|
4441
4510
|
* alertingSchedule
|
|
4442
4511
|
* ).pipe(
|
|
@@ -4449,10 +4518,10 @@ export declare const tapInput: {
|
|
|
4449
4518
|
* // Chain multiple input taps for different purposes
|
|
4450
4519
|
* const comprehensiveSchedule = Schedule.fibonacci("100 millis").pipe(
|
|
4451
4520
|
* Schedule.take(5),
|
|
4452
|
-
* Schedule.tapInput((error:
|
|
4453
|
-
* Console.log(`Error occurred: ${error.
|
|
4521
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4522
|
+
* Console.log(`Error occurred: ${error._tag}`)
|
|
4454
4523
|
* ),
|
|
4455
|
-
* Schedule.tapInput((error:
|
|
4524
|
+
* Schedule.tapInput((error: RetryError) =>
|
|
4456
4525
|
* String(error).length > 20
|
|
4457
4526
|
* ? Console.log("📝 Long error message detected")
|
|
4458
4527
|
* : Effect.void
|
|
@@ -4472,7 +4541,9 @@ export declare const tapInput: {
|
|
|
4472
4541
|
*
|
|
4473
4542
|
* @example
|
|
4474
4543
|
* ```ts
|
|
4475
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4544
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4545
|
+
*
|
|
4546
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
4476
4547
|
*
|
|
4477
4548
|
* // Log schedule outputs for debugging/monitoring
|
|
4478
4549
|
* const monitoredSchedule = Schedule.exponential("100 millis").pipe(
|
|
@@ -4487,7 +4558,7 @@ export declare const tapInput: {
|
|
|
4487
4558
|
* Effect.gen(function*() {
|
|
4488
4559
|
* attempt++
|
|
4489
4560
|
* if (attempt < 4) {
|
|
4490
|
-
* yield* Effect.fail(new
|
|
4561
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
4491
4562
|
* }
|
|
4492
4563
|
* return `Success on attempt ${attempt}`
|
|
4493
4564
|
* }),
|
|
@@ -4556,7 +4627,9 @@ export declare const tapOutput: {
|
|
|
4556
4627
|
*
|
|
4557
4628
|
* @example
|
|
4558
4629
|
* ```ts
|
|
4559
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4630
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4631
|
+
*
|
|
4632
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
4560
4633
|
*
|
|
4561
4634
|
* // Log schedule outputs for debugging/monitoring
|
|
4562
4635
|
* const monitoredSchedule = Schedule.exponential("100 millis").pipe(
|
|
@@ -4571,7 +4644,7 @@ export declare const tapOutput: {
|
|
|
4571
4644
|
* Effect.gen(function*() {
|
|
4572
4645
|
* attempt++
|
|
4573
4646
|
* if (attempt < 4) {
|
|
4574
|
-
* yield* Effect.fail(new
|
|
4647
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
4575
4648
|
* }
|
|
4576
4649
|
* return `Success on attempt ${attempt}`
|
|
4577
4650
|
* }),
|
|
@@ -4640,7 +4713,9 @@ export declare const tapOutput: {
|
|
|
4640
4713
|
*
|
|
4641
4714
|
* @example
|
|
4642
4715
|
* ```ts
|
|
4643
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4716
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4717
|
+
*
|
|
4718
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
4644
4719
|
*
|
|
4645
4720
|
* // Log schedule outputs for debugging/monitoring
|
|
4646
4721
|
* const monitoredSchedule = Schedule.exponential("100 millis").pipe(
|
|
@@ -4655,7 +4730,7 @@ export declare const tapOutput: {
|
|
|
4655
4730
|
* Effect.gen(function*() {
|
|
4656
4731
|
* attempt++
|
|
4657
4732
|
* if (attempt < 4) {
|
|
4658
|
-
* yield* Effect.fail(new
|
|
4733
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
4659
4734
|
* }
|
|
4660
4735
|
* return `Success on attempt ${attempt}`
|
|
4661
4736
|
* }),
|
|
@@ -4725,7 +4800,9 @@ export declare const tapOutput: {
|
|
|
4725
4800
|
*
|
|
4726
4801
|
* @example
|
|
4727
4802
|
* ```ts
|
|
4728
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4803
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4804
|
+
*
|
|
4805
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
4729
4806
|
*
|
|
4730
4807
|
* // Limit an infinite schedule to run only 5 times
|
|
4731
4808
|
* const limitedHeartbeat = Schedule.spaced("1 second").pipe(
|
|
@@ -4758,7 +4835,7 @@ export declare const tapOutput: {
|
|
|
4758
4835
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
4759
4836
|
*
|
|
4760
4837
|
* if (attempt < 5) { // Will fail more than 3 times
|
|
4761
|
-
* yield* Effect.fail(new
|
|
4838
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
4762
4839
|
* }
|
|
4763
4840
|
*
|
|
4764
4841
|
* return `Success on attempt ${attempt}`
|
|
@@ -4804,7 +4881,9 @@ export declare const take: {
|
|
|
4804
4881
|
*
|
|
4805
4882
|
* @example
|
|
4806
4883
|
* ```ts
|
|
4807
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4884
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4885
|
+
*
|
|
4886
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
4808
4887
|
*
|
|
4809
4888
|
* // Limit an infinite schedule to run only 5 times
|
|
4810
4889
|
* const limitedHeartbeat = Schedule.spaced("1 second").pipe(
|
|
@@ -4837,7 +4916,7 @@ export declare const take: {
|
|
|
4837
4916
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
4838
4917
|
*
|
|
4839
4918
|
* if (attempt < 5) { // Will fail more than 3 times
|
|
4840
|
-
* yield* Effect.fail(new
|
|
4919
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
4841
4920
|
* }
|
|
4842
4921
|
*
|
|
4843
4922
|
* return `Success on attempt ${attempt}`
|
|
@@ -4883,7 +4962,9 @@ export declare const take: {
|
|
|
4883
4962
|
*
|
|
4884
4963
|
* @example
|
|
4885
4964
|
* ```ts
|
|
4886
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
4965
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4966
|
+
*
|
|
4967
|
+
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
4887
4968
|
*
|
|
4888
4969
|
* // Limit an infinite schedule to run only 5 times
|
|
4889
4970
|
* const limitedHeartbeat = Schedule.spaced("1 second").pipe(
|
|
@@ -4916,7 +4997,7 @@ export declare const take: {
|
|
|
4916
4997
|
* yield* Console.log(`Attempt ${attempt}`)
|
|
4917
4998
|
*
|
|
4918
4999
|
* if (attempt < 5) { // Will fail more than 3 times
|
|
4919
|
-
* yield* Effect.fail(new
|
|
5000
|
+
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
4920
5001
|
* }
|
|
4921
5002
|
*
|
|
4922
5003
|
* return `Success on attempt ${attempt}`
|
|
@@ -5054,8 +5135,8 @@ export declare const take: {
|
|
|
5054
5135
|
*/
|
|
5055
5136
|
export declare const unfold: <State, Error = never, Env = never>(initial: State, next: (state: State) => Effect<State, Error, Env>) => Schedule<State, unknown, Error, Env>;
|
|
5056
5137
|
declare const while_: {
|
|
5057
|
-
<Input, Output, Error2 = never, Env2 = never>(predicate: (metadata: Metadata<Output, Input>) => Effect<boolean, Error2, Env2>): <Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
5058
|
-
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, predicate: (metadata: Metadata<Output, Input>) => Effect<boolean, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
5138
|
+
<Input, Output, Error2 = never, Env2 = never>(predicate: (metadata: Metadata<Output, Input>) => boolean | Effect<boolean, Error2, Env2>): <Error, Env>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
5139
|
+
<Output, Input, Error, Env, Error2 = never, Env2 = never>(self: Schedule<Output, Input, Error, Env>, predicate: (metadata: Metadata<Output, Input>) => boolean | Effect<boolean, Error2, Env2>): Schedule<Output, Input, Error | Error2, Env | Env2>;
|
|
5059
5140
|
};
|
|
5060
5141
|
export {
|
|
5061
5142
|
/**
|
|
@@ -5104,7 +5185,7 @@ while_ as while };
|
|
|
5104
5185
|
* @since 2.0.0
|
|
5105
5186
|
* @category constructors
|
|
5106
5187
|
*/
|
|
5107
|
-
export declare const windowed: (interval: Duration.
|
|
5188
|
+
export declare const windowed: (interval: Duration.Input) => Schedule<number>;
|
|
5108
5189
|
/**
|
|
5109
5190
|
* Returns a new `Schedule` that will recur forever.
|
|
5110
5191
|
*
|
|
@@ -5174,6 +5255,14 @@ identity_ as identity };
|
|
|
5174
5255
|
* @category ensuring types
|
|
5175
5256
|
*/
|
|
5176
5257
|
export declare const satisfiesInputType: <T>() => <Input extends T, Output = never, Error = never, Env = never>(self: Schedule<Output, Input, Error, Env>) => Schedule<Output, Input, Error, Env>;
|
|
5258
|
+
/**
|
|
5259
|
+
* Sets the input type of the provided schedule to a specified type, without
|
|
5260
|
+
* altering the schedule's behavior.
|
|
5261
|
+
*
|
|
5262
|
+
* @since 2.0.0
|
|
5263
|
+
* @category ensuring types
|
|
5264
|
+
*/
|
|
5265
|
+
export declare const setInputType: <T>() => <Output, Error, Env>(self: Schedule<Output, T, Error, Env>) => Schedule<Output, T, Error, Env>;
|
|
5177
5266
|
/**
|
|
5178
5267
|
* Ensures that the provided schedule respects a specified output type.
|
|
5179
5268
|
*
|