effect 4.0.0-beta.66 → 4.0.0-beta.68
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 +151 -106
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +50 -40
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +620 -553
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +298 -254
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +342 -274
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +168 -126
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +189 -156
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +85 -68
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +30 -5
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +19 -2
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +239 -135
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +135 -59
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +84 -73
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +51 -44
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +1568 -632
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +685 -315
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +119 -10
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -6
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +574 -428
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +250 -191
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +16 -9
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +9 -5
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +11 -5
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +10 -4
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +80 -68
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +53 -49
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +33 -32
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +19 -18
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +76 -50
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +69 -46
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +400 -189
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +143 -77
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +67 -48
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +94 -36
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +208 -0
- package/dist/Crypto.d.ts.map +1 -0
- package/dist/Crypto.js +157 -0
- package/dist/Crypto.js.map +1 -0
- package/dist/Data.d.ts +9 -3
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +893 -464
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +387 -228
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +367 -175
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +146 -72
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +44 -2
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +36 -0
- package/dist/Duration.d.ts +333 -186
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +178 -107
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2181 -2275
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +935 -850
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +38 -3
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -3
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +78 -28
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +75 -27
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +4 -3
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +4 -3
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +18 -24
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +16 -21
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +66 -82
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +38 -29
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +106 -12
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +23 -6
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +6 -5
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +71 -40
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +39 -21
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +118 -57
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +121 -39
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +287 -159
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +175 -73
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +93 -52
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +97 -34
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +102 -73
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +53 -39
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +166 -88
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +68 -42
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +4 -2
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -69
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +218 -151
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +94 -78
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +714 -415
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +325 -182
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +29 -13
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +35 -24
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +27 -17
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +540 -388
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +262 -156
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +53 -34
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +83 -16
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +239 -153
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +110 -56
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +26 -13
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +22 -10
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +336 -222
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +146 -100
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +12 -9
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +9 -6
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +13 -11
- package/dist/JsonPointer.d.ts.map +1 -1
- package/dist/JsonPointer.js +13 -11
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +16 -0
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +10 -0
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +97 -26
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +39 -20
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +472 -410
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +290 -226
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +99 -26
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +58 -14
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +92 -131
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +25 -15
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +159 -104
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +215 -189
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +78 -19
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +24 -17
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +135 -161
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +86 -78
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +330 -291
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +219 -214
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +146 -87
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +67 -43
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +52 -30
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +92 -38
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +110 -68
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +135 -85
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +99 -62
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +78 -60
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +15 -2
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +8 -2
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +38 -48
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +34 -25
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +261 -205
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +119 -91
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +6 -7
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +5 -6
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +133 -156
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +64 -64
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +6 -6
- package/dist/Order.js +6 -6
- package/dist/Ordering.d.ts +56 -45
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +10 -8
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +225 -40
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +113 -17
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +77 -13
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +49 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +77 -18
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +63 -14
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +74 -6
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +68 -5
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +66 -31
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +26 -24
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +16 -23
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +12 -17
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +11 -3
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +9 -2
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +385 -309
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +260 -207
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +94 -25
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +61 -13
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +303 -184
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +231 -134
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +65 -57
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +41 -66
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +151 -141
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +66 -20
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +68 -32
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +33 -16
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +282 -137
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +124 -62
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +7 -5
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +5 -3
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +63 -34
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +31 -15
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +3 -1
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -0
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +85 -66
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +57 -45
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +73 -31
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +66 -30
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +12 -6
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +12 -6
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +159 -34
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +68 -12
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +262 -118
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +78 -42
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +13 -7
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +44 -6
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +135 -151
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +56 -68
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +40 -20
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +34 -17
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +556 -590
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +265 -253
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +44 -7
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +34 -5
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +1293 -602
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +501 -361
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +122 -92
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +102 -77
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +49 -36
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +42 -29
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +19 -24
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +16 -14
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +231 -63
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +266 -75
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +89 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +47 -37
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +97 -46
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +89 -38
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +8 -1
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +24 -1
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +107 -65
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +61 -32
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +141 -49
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +82 -21
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +28 -8
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +25 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +61 -37
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +18 -21
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +461 -206
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +241 -90
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +43 -6
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +33 -4
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +2117 -1541
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +951 -682
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +174 -97
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +128 -69
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +20 -18
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +10 -8
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +309 -204
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +126 -77
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +13 -5
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +13 -5
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +278 -62
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +116 -23
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +26 -2
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +4 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +39 -7
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +10 -4
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +233 -59
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +94 -18
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +280 -245
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +116 -102
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +34 -32
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +16 -14
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +200 -155
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +83 -61
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +43 -29
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +22 -15
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +362 -223
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +171 -98
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +181 -111
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +87 -49
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +94 -63
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +55 -37
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +77 -49
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +60 -37
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +277 -242
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +147 -101
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +69 -46
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +48 -32
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +69 -40
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +34 -19
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +101 -115
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +76 -77
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +74 -50
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +34 -23
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +31 -34
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +62 -25
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +36 -25
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +72 -117
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +20 -6
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +5 -2
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +4 -0
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +1973 -418
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1973 -418
- package/dist/index.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +9 -6
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +9 -6
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +39 -35
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +42 -12
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +44 -36
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +30 -15
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -0
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +9 -7
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +34 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +34 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +205 -147
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +164 -109
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
- package/dist/unstable/ai/Chat.d.ts +64 -41
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +51 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +9 -8
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +28 -18
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +18 -11
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +31 -25
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +20 -14
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +342 -119
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +266 -98
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +56 -20
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +64 -16
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +10 -12
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +9 -7
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
- package/dist/unstable/ai/Prompt.d.ts +200 -176
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +77 -68
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +173 -160
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +43 -48
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +27 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +43 -33
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +15 -11
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +14 -9
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -6
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +167 -96
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +107 -53
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +32 -39
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +7 -5
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +121 -29
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +121 -29
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +226 -134
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +101 -65
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +72 -26
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +86 -23
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +48 -19
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +32 -9
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +196 -115
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +45 -31
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +7 -7
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +235 -142
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +111 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +41 -13
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +30 -7
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +39 -14
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/HelpDoc.js +21 -0
- package/dist/unstable/cli/Param.d.ts +110 -32
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +196 -135
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +79 -42
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +66 -35
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +183 -59
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +105 -23
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +182 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +205 -6
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +13 -0
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +5 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +5 -1
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +3 -0
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +0 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +35 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +56 -7
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +56 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +39 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +61 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +35 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +11 -3
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +74 -16
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +75 -10
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +30 -2
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +18 -3
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +15 -2
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +42 -14
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +30 -14
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +18 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +40 -8
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +43 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +11 -4
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +27 -3
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +24 -2
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +105 -23
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +88 -14
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +88 -13
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +31 -6
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +24 -3
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +21 -2
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +102 -13
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +86 -10
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +126 -21
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +70 -10
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +101 -12
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +64 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -17
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -17
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +34 -2
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +40 -12
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +31 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +38 -4
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +76 -13
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +73 -12
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +53 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +49 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +10 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +35 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +66 -9
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +23 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +15 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +15 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +21 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +90 -19
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +49 -13
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +29 -2
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +18 -1
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +18 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +790 -0
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +790 -0
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js +12 -0
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +26 -3
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +26 -3
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +32 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +102 -20
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +21 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +58 -0
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +58 -0
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +81 -12
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +75 -9
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +149 -21
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +97 -13
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +109 -18
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +69 -13
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +49 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +49 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +115 -30
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +22 -2
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +24 -6
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +108 -16
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +150 -31
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +111 -20
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +92 -18
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +72 -16
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +54 -8
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +17 -3
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +240 -0
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +240 -0
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +156 -77
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +93 -39
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +40 -7
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +27 -4
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +33 -4
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/FindMyWay.d.ts +1 -1
- package/dist/unstable/http/FindMyWay.js +1 -1
- package/dist/unstable/http/Headers.d.ts +182 -36
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +86 -16
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +114 -26
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +98 -20
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +204 -96
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +85 -38
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +68 -12
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +71 -9
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +151 -45
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +44 -11
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +42 -16
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +33 -13
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +48 -7
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +45 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +38 -6
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +27 -2
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +38 -11
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +52 -10
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +34 -3
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +34 -3
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +209 -62
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +136 -41
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +151 -22
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +76 -11
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +93 -10
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +85 -8
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +101 -20
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +43 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +391 -67
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +205 -33
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +24 -8
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +24 -8
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +47 -5
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +179 -28
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +131 -19
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Node.js +1 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Search.js +1 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Web.js +1 -1
- package/dist/unstable/http/Multipasta.d.ts +1 -1
- package/dist/unstable/http/Multipasta.js +1 -1
- package/dist/unstable/http/Template.d.ts +53 -1
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +26 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +70 -56
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +35 -21
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +237 -51
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +120 -25
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +452 -0
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +452 -0
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +14 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +54 -16
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +44 -6
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +57 -15
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +42 -6
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +98 -1
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -5
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +86 -38
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +59 -35
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +73 -17
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +4 -3
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +23 -3
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +6 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +26 -1
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +73 -15
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +310 -25
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +310 -25
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +33 -3
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +14 -3
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +32 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +15 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +29 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +17 -5
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +32 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +49 -12
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +47 -5
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +28 -3
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +19 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +32 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +36 -16
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +9 -7
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.d.ts +160 -3
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +160 -3
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +81 -21
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +76 -15
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +22 -5
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +24 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +60 -13
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +98 -16
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +91 -14
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +101 -21
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +85 -16
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +26 -5
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +36 -4
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +147 -0
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +147 -0
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +87 -64
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +25 -18
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +23 -12
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +11 -6
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +2 -1
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +2 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +198 -59
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +121 -36
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +544 -130
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +252 -58
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +29 -3
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +69 -10
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +29 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +28 -5
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +35 -3
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +94 -13
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +60 -7
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +167 -0
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +167 -0
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +254 -56
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +44 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +80 -19
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +52 -12
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +26 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +23 -7
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +39 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +34 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +56 -12
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +73 -23
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +69 -22
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +20 -1
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +20 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +39 -6
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +16 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +10 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +10 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +272 -0
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +272 -0
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +192 -59
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +122 -38
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +101 -24
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +22 -6
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.d.ts +37 -0
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +37 -0
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +168 -34
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +124 -28
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +58 -10
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +43 -5
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/socket/index.d.ts +44 -0
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +44 -0
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +40 -9
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +45 -5
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +38 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +40 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +34 -3
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +22 -0
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +117 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +131 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +25 -5
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +8 -4
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +56 -13
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +44 -10
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +29 -8
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +29 -8
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts +4 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +24 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +151 -24
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +91 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +179 -1
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +179 -1
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +72 -20
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +57 -14
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +61 -8
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +44 -4
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +31 -9
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +44 -7
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +24 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +81 -1
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +81 -1
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +61 -10
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +20 -5
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +12 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +22 -2
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +128 -31
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +77 -13
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +33 -8
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +26 -6
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +102 -31
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +75 -19
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -4
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +40 -12
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +8 -12
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +37 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +160 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +160 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +11 -11
- package/src/Array.ts +151 -106
- package/src/BigDecimal.ts +620 -553
- package/src/BigInt.ts +342 -274
- package/src/Boolean.ts +189 -156
- package/src/Brand.ts +30 -5
- package/src/Cache.ts +334 -167
- package/src/Cause.ts +84 -73
- package/src/Channel.ts +1639 -667
- package/src/ChannelSchema.ts +137 -12
- package/src/Chunk.ts +575 -429
- package/src/Clock.ts +16 -9
- package/src/Combiner.ts +11 -5
- package/src/Config.ts +80 -68
- package/src/ConfigProvider.ts +33 -32
- package/src/Console.ts +88 -58
- package/src/Context.ts +401 -190
- package/src/Cron.ts +109 -48
- package/src/Crypto.ts +327 -0
- package/src/Data.ts +9 -3
- package/src/DateTime.ts +893 -464
- package/src/Deferred.ts +367 -175
- package/src/Differ.ts +44 -2
- package/src/Duration.ts +333 -186
- package/src/Effect.ts +2201 -2289
- package/src/Effectable.ts +38 -3
- package/src/Encoding.ts +78 -28
- package/src/Equal.ts +4 -3
- package/src/Equivalence.ts +18 -24
- package/src/ErrorReporter.ts +66 -82
- package/src/ExecutionPlan.ts +106 -12
- package/src/Exit.ts +6 -5
- package/src/Fiber.ts +71 -40
- package/src/FiberHandle.ts +157 -57
- package/src/FiberMap.ts +328 -163
- package/src/FiberSet.ts +130 -52
- package/src/FileSystem.ts +104 -74
- package/src/Filter.ts +166 -88
- package/src/Formatter.ts +4 -70
- package/src/Function.ts +218 -151
- package/src/Graph.ts +714 -415
- package/src/HKT.ts +29 -13
- package/src/Hash.ts +35 -24
- package/src/HashMap.ts +540 -388
- package/src/HashRing.ts +111 -34
- package/src/HashSet.ts +239 -153
- package/src/Inspectable.ts +30 -17
- package/src/Iterable.ts +336 -222
- package/src/JsonPatch.ts +13 -10
- package/src/JsonPointer.ts +13 -11
- package/src/JsonSchema.ts +16 -0
- package/src/Latch.ts +97 -26
- package/src/Layer.ts +547 -445
- package/src/LayerMap.ts +99 -26
- package/src/LogLevel.ts +92 -131
- package/src/Logger.ts +365 -297
- package/src/ManagedRuntime.ts +78 -19
- package/src/Match.ts +135 -161
- package/src/Metric.ts +362 -313
- package/src/MutableHashMap.ts +202 -127
- package/src/MutableHashSet.ts +120 -52
- package/src/MutableList.ts +157 -100
- package/src/MutableRef.ts +129 -90
- package/src/Newtype.ts +15 -2
- package/src/NonEmptyIterable.ts +38 -48
- package/src/Number.ts +261 -205
- package/src/Optic.ts +6 -7
- package/src/Option.ts +133 -156
- package/src/Order.ts +6 -6
- package/src/Ordering.ts +56 -45
- package/src/PartitionedSemaphore.ts +225 -40
- package/src/Path.ts +77 -13
- package/src/Pipeable.ts +82 -24
- package/src/PlatformError.ts +74 -6
- package/src/Pool.ts +94 -31
- package/src/Predicate.ts +17 -24
- package/src/PrimaryKey.ts +11 -3
- package/src/PubSub.ts +385 -309
- package/src/Pull.ts +94 -25
- package/src/Queue.ts +303 -184
- package/src/Random.ts +69 -93
- package/src/RcMap.ts +151 -141
- package/src/RcRef.ts +68 -32
- package/src/Record.ts +282 -137
- package/src/Redactable.ts +7 -5
- package/src/Redacted.ts +63 -34
- package/src/Reducer.ts +3 -1
- package/src/Ref.ts +173 -134
- package/src/References.ts +73 -31
- package/src/RegExp.ts +12 -6
- package/src/Request.ts +159 -34
- package/src/RequestResolver.ts +278 -121
- package/src/Resource.ts +45 -7
- package/src/Result.ts +137 -153
- package/src/Runtime.ts +42 -21
- package/src/Schedule.ts +585 -613
- package/src/Scheduler.ts +44 -7
- package/src/Schema.ts +1309 -615
- package/src/SchemaAST.ts +123 -93
- package/src/SchemaGetter.ts +52 -37
- package/src/SchemaIssue.ts +19 -24
- package/src/SchemaParser.ts +306 -85
- package/src/SchemaRepresentation.ts +89 -77
- package/src/SchemaTransformation.ts +97 -46
- package/src/SchemaUtils.ts +24 -1
- package/src/Scope.ts +107 -65
- package/src/ScopedCache.ts +195 -59
- package/src/ScopedRef.ts +28 -8
- package/src/Semaphore.ts +61 -37
- package/src/Sink.ts +461 -206
- package/src/Stdio.ts +43 -6
- package/src/Stream.ts +2361 -1613
- package/src/String.ts +174 -97
- package/src/Struct.ts +20 -18
- package/src/SubscriptionRef.ts +309 -204
- package/src/Symbol.ts +13 -5
- package/src/SynchronizedRef.ts +278 -62
- package/src/Take.ts +26 -2
- package/src/Terminal.ts +40 -7
- package/src/Tracer.ts +233 -59
- package/src/Trie.ts +280 -245
- package/src/Tuple.ts +34 -32
- package/src/TxChunk.ts +200 -155
- package/src/TxDeferred.ts +43 -29
- package/src/TxHashMap.ts +370 -231
- package/src/TxHashSet.ts +253 -159
- package/src/TxPriorityQueue.ts +97 -65
- package/src/TxPubSub.ts +77 -49
- package/src/TxQueue.ts +277 -242
- package/src/TxReentrantLock.ts +70 -47
- package/src/TxRef.ts +69 -40
- package/src/TxSemaphore.ts +101 -115
- package/src/TxSubscriptionRef.ts +74 -50
- package/src/Types.ts +31 -34
- package/src/UndefinedOr.ts +62 -25
- package/src/Unify.ts +72 -117
- package/src/Utils.ts +5 -2
- package/src/index.ts +1976 -420
- package/src/internal/schema/schema.ts +1 -1
- package/src/testing/FastCheck.ts +9 -6
- package/src/testing/TestClock.ts +63 -35
- package/src/testing/TestConsole.ts +54 -36
- package/src/testing/TestSchema.ts +10 -8
- package/src/testing/index.ts +34 -0
- package/src/unstable/ai/AiError.ts +195 -137
- package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
- package/src/unstable/ai/Chat.ts +68 -43
- package/src/unstable/ai/EmbeddingModel.ts +12 -11
- package/src/unstable/ai/IdGenerator.ts +28 -18
- package/src/unstable/ai/LanguageModel.ts +35 -27
- package/src/unstable/ai/McpSchema.ts +342 -119
- package/src/unstable/ai/McpServer.ts +79 -20
- package/src/unstable/ai/Model.ts +10 -12
- package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
- package/src/unstable/ai/Prompt.ts +216 -192
- package/src/unstable/ai/Response.ts +179 -167
- package/src/unstable/ai/ResponseIdTracker.ts +43 -4
- package/src/unstable/ai/Telemetry.ts +43 -33
- package/src/unstable/ai/Tokenizer.ts +14 -9
- package/src/unstable/ai/Tool.ts +168 -97
- package/src/unstable/ai/Toolkit.ts +51 -46
- package/src/unstable/ai/index.ts +121 -29
- package/src/unstable/cli/Argument.ts +226 -134
- package/src/unstable/cli/CliError.ts +96 -26
- package/src/unstable/cli/CliOutput.ts +48 -19
- package/src/unstable/cli/Command.ts +196 -115
- package/src/unstable/cli/Completions.ts +7 -7
- package/src/unstable/cli/Flag.ts +235 -142
- package/src/unstable/cli/GlobalFlag.ts +41 -13
- package/src/unstable/cli/HelpDoc.ts +39 -14
- package/src/unstable/cli/Param.ts +395 -260
- package/src/unstable/cli/Primitive.ts +79 -42
- package/src/unstable/cli/Prompt.ts +207 -59
- package/src/unstable/cli/index.ts +205 -6
- package/src/unstable/cli/internal/ansi.ts +13 -0
- package/src/unstable/cli/internal/command.ts +5 -1
- package/src/unstable/cli/internal/config.ts +3 -0
- package/src/unstable/cli/internal/lexer.ts +11 -0
- package/src/unstable/cli/internal/parser.ts +0 -1
- package/src/unstable/cluster/ClusterCron.ts +35 -1
- package/src/unstable/cluster/ClusterError.ts +56 -7
- package/src/unstable/cluster/ClusterMetrics.ts +39 -5
- package/src/unstable/cluster/ClusterSchema.ts +61 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -2
- package/src/unstable/cluster/DeliverAt.ts +39 -4
- package/src/unstable/cluster/Entity.ts +106 -16
- package/src/unstable/cluster/EntityAddress.ts +30 -2
- package/src/unstable/cluster/EntityId.ts +18 -3
- package/src/unstable/cluster/EntityProxy.ts +42 -14
- package/src/unstable/cluster/EntityProxyServer.ts +45 -8
- package/src/unstable/cluster/EntityResource.ts +43 -6
- package/src/unstable/cluster/EntityType.ts +27 -3
- package/src/unstable/cluster/Envelope.ts +128 -23
- package/src/unstable/cluster/HttpRunner.ts +88 -13
- package/src/unstable/cluster/K8sHttpClient.ts +49 -6
- package/src/unstable/cluster/MachineId.ts +24 -3
- package/src/unstable/cluster/Message.ts +102 -13
- package/src/unstable/cluster/MessageStorage.ts +126 -21
- package/src/unstable/cluster/Reply.ts +101 -12
- package/src/unstable/cluster/Runner.ts +47 -17
- package/src/unstable/cluster/RunnerAddress.ts +34 -2
- package/src/unstable/cluster/RunnerHealth.ts +40 -12
- package/src/unstable/cluster/RunnerServer.ts +31 -4
- package/src/unstable/cluster/RunnerStorage.ts +42 -5
- package/src/unstable/cluster/Runners.ts +76 -13
- package/src/unstable/cluster/ShardId.ts +53 -5
- package/src/unstable/cluster/Sharding.ts +35 -4
- package/src/unstable/cluster/ShardingConfig.ts +75 -10
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
- package/src/unstable/cluster/SingleRunner.ts +23 -1
- package/src/unstable/cluster/Singleton.ts +15 -1
- package/src/unstable/cluster/SingletonAddress.ts +21 -1
- package/src/unstable/cluster/Snowflake.ts +90 -19
- package/src/unstable/cluster/SocketRunner.ts +29 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
- package/src/unstable/cluster/TestRunner.ts +18 -1
- package/src/unstable/cluster/index.ts +790 -0
- package/src/unstable/cluster/internal/hash.ts +12 -0
- package/src/unstable/devtools/DevTools.ts +26 -3
- package/src/unstable/devtools/DevToolsClient.ts +32 -5
- package/src/unstable/devtools/DevToolsSchema.ts +201 -44
- package/src/unstable/devtools/DevToolsServer.ts +27 -2
- package/src/unstable/devtools/index.ts +58 -0
- package/src/unstable/encoding/Msgpack.ts +97 -12
- package/src/unstable/encoding/Ndjson.ts +149 -21
- package/src/unstable/encoding/Sse.ts +109 -18
- package/src/unstable/encoding/index.ts +49 -0
- package/src/unstable/eventlog/Event.ts +131 -30
- package/src/unstable/eventlog/EventGroup.ts +50 -17
- package/src/unstable/eventlog/EventJournal.ts +120 -20
- package/src/unstable/eventlog/EventLog.ts +150 -31
- package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
- package/src/unstable/eventlog/EventLogMessage.ts +92 -18
- package/src/unstable/eventlog/EventLogRemote.ts +54 -8
- package/src/unstable/eventlog/EventLogServer.ts +33 -3
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
- package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
- package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
- package/src/unstable/eventlog/index.ts +240 -0
- package/src/unstable/http/Cookies.ts +156 -77
- package/src/unstable/http/Etag.ts +40 -7
- package/src/unstable/http/FetchHttpClient.ts +33 -4
- package/src/unstable/http/FindMyWay.ts +1 -1
- package/src/unstable/http/Headers.ts +252 -50
- package/src/unstable/http/HttpBody.ts +128 -26
- package/src/unstable/http/HttpClient.ts +204 -96
- package/src/unstable/http/HttpClientError.ts +80 -12
- package/src/unstable/http/HttpClientRequest.ts +318 -100
- package/src/unstable/http/HttpClientResponse.ts +59 -16
- package/src/unstable/http/HttpEffect.ts +66 -18
- package/src/unstable/http/HttpIncomingMessage.ts +48 -7
- package/src/unstable/http/HttpMethod.ts +38 -6
- package/src/unstable/http/HttpMiddleware.ts +60 -11
- package/src/unstable/http/HttpPlatform.ts +34 -3
- package/src/unstable/http/HttpRouter.ts +232 -69
- package/src/unstable/http/HttpServer.ts +151 -22
- package/src/unstable/http/HttpServerError.ts +93 -10
- package/src/unstable/http/HttpServerRequest.ts +125 -21
- package/src/unstable/http/HttpServerRespondable.ts +49 -6
- package/src/unstable/http/HttpServerResponse.ts +391 -67
- package/src/unstable/http/HttpStaticServer.ts +24 -8
- package/src/unstable/http/HttpTraceContext.ts +53 -6
- package/src/unstable/http/Multipart.ts +179 -28
- package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
- package/src/unstable/http/Multipasta/Node.ts +1 -1
- package/src/unstable/http/Multipasta/Search.ts +1 -1
- package/src/unstable/http/Multipasta/Web.ts +1 -1
- package/src/unstable/http/Multipasta.ts +1 -1
- package/src/unstable/http/Template.ts +53 -1
- package/src/unstable/http/Url.ts +70 -56
- package/src/unstable/http/UrlParams.ts +237 -51
- package/src/unstable/http/index.ts +452 -0
- package/src/unstable/httpapi/HttpApi.ts +49 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +81 -16
- package/src/unstable/httpapi/HttpApiClient.ts +78 -15
- package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
- package/src/unstable/httpapi/HttpApiError.ts +100 -1
- package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
- package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -22
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
- package/src/unstable/httpapi/HttpApiSchema.ts +86 -38
- package/src/unstable/httpapi/HttpApiSecurity.ts +73 -17
- package/src/unstable/httpapi/HttpApiSwagger.ts +23 -3
- package/src/unstable/httpapi/HttpApiTest.ts +26 -1
- package/src/unstable/httpapi/OpenApi.ts +115 -15
- package/src/unstable/httpapi/index.ts +310 -25
- package/src/unstable/observability/Otlp.ts +33 -3
- package/src/unstable/observability/OtlpExporter.ts +32 -1
- package/src/unstable/observability/OtlpLogger.ts +32 -2
- package/src/unstable/observability/OtlpMetrics.ts +39 -5
- package/src/unstable/observability/OtlpResource.ts +68 -12
- package/src/unstable/observability/OtlpSerialization.ts +28 -3
- package/src/unstable/observability/OtlpTracer.ts +41 -2
- package/src/unstable/observability/PrometheusMetrics.ts +36 -16
- package/src/unstable/observability/index.ts +160 -3
- package/src/unstable/persistence/KeyValueStore.ts +108 -28
- package/src/unstable/persistence/Persistable.ts +76 -15
- package/src/unstable/persistence/PersistedCache.ts +27 -2
- package/src/unstable/persistence/PersistedQueue.ts +98 -16
- package/src/unstable/persistence/Persistence.ts +98 -16
- package/src/unstable/persistence/RateLimiter.ts +101 -21
- package/src/unstable/persistence/Redis.ts +42 -5
- package/src/unstable/persistence/index.ts +147 -0
- package/src/unstable/process/ChildProcess.ts +90 -66
- package/src/unstable/process/ChildProcessSpawner.ts +23 -12
- package/src/unstable/process/index.ts +2 -1
- package/src/unstable/reactivity/AsyncResult.ts +204 -61
- package/src/unstable/reactivity/Atom.ts +598 -139
- package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
- package/src/unstable/reactivity/AtomRef.ts +51 -7
- package/src/unstable/reactivity/AtomRegistry.ts +141 -22
- package/src/unstable/reactivity/AtomRpc.ts +36 -2
- package/src/unstable/reactivity/Hydration.ts +45 -5
- package/src/unstable/reactivity/Reactivity.ts +94 -13
- package/src/unstable/reactivity/index.ts +167 -0
- package/src/unstable/rpc/Rpc.ts +254 -56
- package/src/unstable/rpc/RpcClient.ts +106 -19
- package/src/unstable/rpc/RpcClientError.ts +26 -2
- package/src/unstable/rpc/RpcGroup.ts +51 -8
- package/src/unstable/rpc/RpcMessage.ts +128 -32
- package/src/unstable/rpc/RpcMiddleware.ts +100 -20
- package/src/unstable/rpc/RpcSchema.ts +38 -4
- package/src/unstable/rpc/RpcSerialization.ts +60 -13
- package/src/unstable/rpc/RpcServer.ts +107 -23
- package/src/unstable/rpc/RpcTest.ts +20 -1
- package/src/unstable/rpc/RpcWorker.ts +39 -6
- package/src/unstable/rpc/Utils.ts +33 -0
- package/src/unstable/rpc/index.ts +272 -0
- package/src/unstable/schema/Model.ts +245 -61
- package/src/unstable/schema/VariantSchema.ts +101 -24
- package/src/unstable/schema/index.ts +37 -0
- package/src/unstable/socket/Socket.ts +168 -34
- package/src/unstable/socket/SocketServer.ts +58 -10
- package/src/unstable/socket/index.ts +44 -0
- package/src/unstable/sql/Migrator.ts +61 -9
- package/src/unstable/sql/SqlClient.ts +59 -2
- package/src/unstable/sql/SqlConnection.ts +34 -3
- package/src/unstable/sql/SqlError.ts +135 -0
- package/src/unstable/sql/SqlModel.ts +25 -5
- package/src/unstable/sql/SqlResolver.ts +56 -13
- package/src/unstable/sql/SqlSchema.ts +29 -8
- package/src/unstable/sql/SqlStream.ts +24 -0
- package/src/unstable/sql/Statement.ts +168 -24
- package/src/unstable/sql/index.ts +179 -1
- package/src/unstable/workers/Transferable.ts +72 -20
- package/src/unstable/workers/Worker.ts +61 -8
- package/src/unstable/workers/WorkerError.ts +50 -9
- package/src/unstable/workers/WorkerRunner.ts +32 -3
- package/src/unstable/workers/index.ts +81 -1
- package/src/unstable/workflow/Activity.ts +61 -10
- package/src/unstable/workflow/DurableClock.ts +26 -3
- package/src/unstable/workflow/DurableDeferred.ts +148 -31
- package/src/unstable/workflow/DurableQueue.ts +33 -8
- package/src/unstable/workflow/Workflow.ts +123 -31
- package/src/unstable/workflow/WorkflowEngine.ts +40 -5
- package/src/unstable/workflow/WorkflowProxy.ts +40 -12
- package/src/unstable/workflow/WorkflowProxyServer.ts +41 -6
- package/src/unstable/workflow/index.ts +160 -0
package/src/Schedule.ts
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* along with a delay duration. Schedules can be combined, transformed, and used to implement
|
|
7
7
|
* sophisticated retry and repetition logic.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* **Example** (Retrying and repeating effects)
|
|
10
|
+
*
|
|
10
11
|
* ```ts
|
|
11
12
|
* import { Effect, Schedule } from "effect"
|
|
12
13
|
*
|
|
@@ -53,9 +54,14 @@ const randomNext: Effect<number> = random.Random.useSync((random) => random.next
|
|
|
53
54
|
/**
|
|
54
55
|
* A Schedule defines a strategy for repeating or retrying effects based on some policy.
|
|
55
56
|
*
|
|
56
|
-
*
|
|
57
|
+
* **Example** (Defining retry and repeat schedules)
|
|
58
|
+
*
|
|
57
59
|
* ```ts
|
|
58
|
-
* import { Console, Effect, Schedule } from "effect"
|
|
60
|
+
* import { Console, Data, Effect, Schedule } from "effect"
|
|
61
|
+
*
|
|
62
|
+
* class NetworkError extends Data.TaggedError("NetworkError")<{
|
|
63
|
+
* readonly attempt: number
|
|
64
|
+
* }> {}
|
|
59
65
|
*
|
|
60
66
|
* // Basic retry schedule - retry up to 3 times with exponential backoff
|
|
61
67
|
* const retrySchedule = Schedule.exponential("100 millis").pipe(
|
|
@@ -66,25 +72,29 @@ const randomNext: Effect<number> = random.Random.useSync((random) => random.next
|
|
|
66
72
|
* const repeatSchedule: Schedule.Schedule<number, unknown, never> = Schedule
|
|
67
73
|
* .spaced("30 seconds")
|
|
68
74
|
*
|
|
69
|
-
* // Advanced schedule with custom logic
|
|
70
|
-
* const smartRetry = Schedule.exponential("1 second")
|
|
71
|
-
*
|
|
72
75
|
* const program = Effect.gen(function*() {
|
|
73
|
-
*
|
|
76
|
+
* let attempts = 0
|
|
77
|
+
*
|
|
74
78
|
* const result1 = yield* Effect.retry(
|
|
75
|
-
* Effect.
|
|
79
|
+
* Effect.gen(function*() {
|
|
80
|
+
* attempts++
|
|
81
|
+
* if (attempts < 3) {
|
|
82
|
+
* return yield* Effect.fail(new NetworkError({ attempt: attempts }))
|
|
83
|
+
* }
|
|
84
|
+
* return "Success"
|
|
85
|
+
* }),
|
|
76
86
|
* retrySchedule
|
|
77
87
|
* )
|
|
88
|
+
* console.log(result1) // "Success"
|
|
78
89
|
*
|
|
79
|
-
* // Using repeat schedule
|
|
80
90
|
* yield* Console.log("heartbeat").pipe(
|
|
81
91
|
* Effect.repeat(repeatSchedule.pipe(Schedule.take(5)))
|
|
82
92
|
* )
|
|
83
93
|
* })
|
|
84
94
|
* ```
|
|
85
95
|
*
|
|
96
|
+
* @category models
|
|
86
97
|
* @since 2.0.0
|
|
87
|
-
* @category Models
|
|
88
98
|
*/
|
|
89
99
|
export interface Schedule<out Output, in Input = unknown, out Error = never, out Env = never>
|
|
90
100
|
extends Schedule.Variance<Output, Input, Error, Env>, Pipeable
|
|
@@ -93,7 +103,8 @@ export interface Schedule<out Output, in Input = unknown, out Error = never, out
|
|
|
93
103
|
/**
|
|
94
104
|
* Metadata provided to schedule functions containing timing and input information.
|
|
95
105
|
*
|
|
96
|
-
*
|
|
106
|
+
* **Example** (Reading schedule input metadata)
|
|
107
|
+
*
|
|
97
108
|
* ```ts
|
|
98
109
|
* import { Console, Effect, Schedule } from "effect"
|
|
99
110
|
*
|
|
@@ -112,8 +123,8 @@ export interface Schedule<out Output, in Input = unknown, out Error = never, out
|
|
|
112
123
|
* })
|
|
113
124
|
* ```
|
|
114
125
|
*
|
|
115
|
-
* @since 4.0.0
|
|
116
126
|
* @category Metadata
|
|
127
|
+
* @since 4.0.0
|
|
117
128
|
*/
|
|
118
129
|
export interface InputMetadata<Input> {
|
|
119
130
|
readonly input: Input
|
|
@@ -127,18 +138,19 @@ export interface InputMetadata<Input> {
|
|
|
127
138
|
/**
|
|
128
139
|
* Extended metadata that includes both input metadata and the output value from the schedule.
|
|
129
140
|
*
|
|
130
|
-
*
|
|
141
|
+
* **Example** (Logging schedule output metadata)
|
|
142
|
+
*
|
|
131
143
|
* ```ts
|
|
132
144
|
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
133
145
|
*
|
|
134
|
-
* // Custom schedule that logs metadata
|
|
146
|
+
* // Custom schedule that logs metadata and output for each recurrence
|
|
135
147
|
* const loggingSchedule = Schedule.unfold(0, (n) => Effect.succeed(n + 1)).pipe(
|
|
136
148
|
* Schedule.addDelay(() => Effect.succeed(Duration.millis(100))),
|
|
137
|
-
* Schedule.
|
|
138
|
-
*
|
|
139
|
-
* `Output: ${output}`
|
|
140
|
-
* )
|
|
141
|
-
*
|
|
149
|
+
* Schedule.collectWhile((metadata) =>
|
|
150
|
+
* Console.log(
|
|
151
|
+
* `Output: ${metadata.output}, attempt: ${metadata.attempt}, elapsed: ${metadata.elapsed}ms`
|
|
152
|
+
* ).pipe(Effect.as(metadata.attempt <= 3))
|
|
153
|
+
* )
|
|
142
154
|
* )
|
|
143
155
|
*
|
|
144
156
|
* const program = Effect.gen(function*() {
|
|
@@ -149,13 +161,13 @@ export interface InputMetadata<Input> {
|
|
|
149
161
|
* })
|
|
150
162
|
*
|
|
151
163
|
* // Output logs will show:
|
|
152
|
-
* //
|
|
153
|
-
* //
|
|
154
|
-
* //
|
|
164
|
+
* // Output: 0, attempt: 1, elapsed: 0ms
|
|
165
|
+
* // Output: 1, attempt: 2, elapsed: 100ms
|
|
166
|
+
* // Output: 2, attempt: 3, elapsed: 200ms
|
|
155
167
|
* ```
|
|
156
168
|
*
|
|
157
|
-
* @since 4.0.0
|
|
158
169
|
* @category Metadata
|
|
170
|
+
* @since 4.0.0
|
|
159
171
|
*/
|
|
160
172
|
export interface Metadata<Output = unknown, Input = unknown> extends InputMetadata<Input> {
|
|
161
173
|
readonly output: Output
|
|
@@ -163,8 +175,16 @@ export interface Metadata<Output = unknown, Input = unknown> extends InputMetada
|
|
|
163
175
|
}
|
|
164
176
|
|
|
165
177
|
/**
|
|
166
|
-
*
|
|
178
|
+
* Context reference containing metadata for the currently running schedule step.
|
|
179
|
+
*
|
|
180
|
+
* **Details**
|
|
181
|
+
* Repeat, retry, stream, and channel scheduling operations provide this service
|
|
182
|
+
* to effects run between schedule steps. The default value contains undefined
|
|
183
|
+
* input and output values, zero duration, and zeroed timing fields before any
|
|
184
|
+
* schedule step has produced metadata.
|
|
185
|
+
*
|
|
167
186
|
* @category Metadata
|
|
187
|
+
* @since 4.0.0
|
|
168
188
|
*/
|
|
169
189
|
export const CurrentMetadata = Context.Reference<Metadata>("effect/Schedule/CurrentMetadata", {
|
|
170
190
|
defaultValue: constant({
|
|
@@ -182,7 +202,8 @@ export const CurrentMetadata = Context.Reference<Metadata>("effect/Schedule/Curr
|
|
|
182
202
|
/**
|
|
183
203
|
* The Schedule namespace contains types and utilities for working with schedules.
|
|
184
204
|
*
|
|
185
|
-
*
|
|
205
|
+
* **Example** (Creating custom schedules with the namespace)
|
|
206
|
+
*
|
|
186
207
|
* ```ts
|
|
187
208
|
* import { Duration, Effect, Schedule } from "effect"
|
|
188
209
|
*
|
|
@@ -210,13 +231,13 @@ export const CurrentMetadata = Context.Reference<Metadata>("effect/Schedule/Curr
|
|
|
210
231
|
* ```
|
|
211
232
|
*
|
|
212
233
|
* @since 2.0.0
|
|
213
|
-
* @category models
|
|
214
234
|
*/
|
|
215
235
|
export declare namespace Schedule {
|
|
216
236
|
/**
|
|
217
237
|
* Variance interface that defines the type parameter relationships for Schedule.
|
|
218
238
|
*
|
|
219
|
-
*
|
|
239
|
+
* **Example** (Understanding schedule variance)
|
|
240
|
+
*
|
|
220
241
|
* ```ts
|
|
221
242
|
* import { Effect, Schedule } from "effect"
|
|
222
243
|
*
|
|
@@ -240,44 +261,23 @@ export declare namespace Schedule {
|
|
|
240
261
|
* const serviceSchedule = Schedule.spaced("5 seconds")
|
|
241
262
|
* ```
|
|
242
263
|
*
|
|
264
|
+
* @category models
|
|
243
265
|
* @since 2.0.0
|
|
244
|
-
* @category Models
|
|
245
266
|
*/
|
|
246
267
|
export interface Variance<out Output, in Input, out Error, out Env> {
|
|
247
268
|
readonly [TypeId]: VarianceStruct<Output, Input, Error, Env>
|
|
248
269
|
}
|
|
249
270
|
|
|
250
271
|
/**
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
* @example
|
|
254
|
-
* ```ts
|
|
255
|
-
* import { Effect, Schedule } from "effect"
|
|
272
|
+
* Type-level marker used by `Schedule.Variance` to record the variance of
|
|
273
|
+
* `Schedule` type parameters.
|
|
256
274
|
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
275
|
+
* **Notes**
|
|
276
|
+
* This interface exists for TypeScript inference and assignability. Users
|
|
277
|
+
* normally do not construct or inspect it directly.
|
|
259
278
|
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* name: string
|
|
263
|
-
* }
|
|
264
|
-
* interface Dog extends Animal {
|
|
265
|
-
* breed: string
|
|
266
|
-
* }
|
|
267
|
-
*
|
|
268
|
-
* // Output is covariant - more specific types can be substituted
|
|
269
|
-
* const stringSchedule = Schedule.spaced("1 second").pipe(
|
|
270
|
-
* Schedule.map(() => Effect.succeed("output"))
|
|
271
|
-
* )
|
|
272
|
-
*
|
|
273
|
-
* // Input is contravariant - more general types can be accepted
|
|
274
|
-
* const numberSchedule = Schedule.exponential("100 millis")
|
|
275
|
-
*
|
|
276
|
-
* // This enables proper type relationships where schedules can be composed safely
|
|
277
|
-
* ```
|
|
278
|
-
*
|
|
279
|
-
* @since 2.0.0
|
|
280
|
-
* @category Models
|
|
279
|
+
* @category models
|
|
280
|
+
* @since 4.0.0
|
|
281
281
|
*/
|
|
282
282
|
export interface VarianceStruct<out Output, in Input, out Error, out Env> {
|
|
283
283
|
readonly _Out: Covariant<Output>
|
|
@@ -301,7 +301,8 @@ const ScheduleProto = {
|
|
|
301
301
|
/**
|
|
302
302
|
* Type guard that checks if a value is a Schedule.
|
|
303
303
|
*
|
|
304
|
-
*
|
|
304
|
+
* **Example** (Checking for schedules)
|
|
305
|
+
*
|
|
305
306
|
* ```ts
|
|
306
307
|
* import { Schedule } from "effect"
|
|
307
308
|
*
|
|
@@ -314,34 +315,33 @@ const ScheduleProto = {
|
|
|
314
315
|
* console.log(Schedule.isSchedule(undefined)) // false
|
|
315
316
|
* ```
|
|
316
317
|
*
|
|
317
|
-
* @since 2.0.0
|
|
318
318
|
* @category guards
|
|
319
|
+
* @since 2.0.0
|
|
319
320
|
*/
|
|
320
321
|
export const isSchedule = (u: unknown): u is Schedule<unknown, never, unknown, unknown> => hasProperty(u, TypeId)
|
|
321
322
|
|
|
322
323
|
/**
|
|
323
324
|
* Creates a Schedule from a step function that returns a Pull.
|
|
324
325
|
*
|
|
325
|
-
*
|
|
326
|
-
* ```ts
|
|
327
|
-
* import { Schedule } from "effect"
|
|
326
|
+
* **Example** (Creating a custom schedule from a step function)
|
|
328
327
|
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
328
|
+
* ```ts
|
|
329
|
+
* import { Cause, Duration, Effect, Schedule } from "effect"
|
|
331
330
|
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
* const spacedSchedule = Schedule.spaced("1 second")
|
|
335
|
-
* const recurringSchedule = Schedule.recurs(5)
|
|
331
|
+
* const schedule = Schedule.fromStep(Effect.sync(() => {
|
|
332
|
+
* let count = 0
|
|
336
333
|
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
334
|
+
* return (_now: number, _input: string) => {
|
|
335
|
+
* if (count >= 3) {
|
|
336
|
+
* return Cause.done(count)
|
|
337
|
+
* }
|
|
338
|
+
* return Effect.succeed([count++, Duration.millis(100)] as [number, Duration.Duration])
|
|
339
|
+
* }
|
|
340
|
+
* }))
|
|
341
341
|
* ```
|
|
342
342
|
*
|
|
343
|
-
* @since 4.0.0
|
|
344
343
|
* @category constructors
|
|
344
|
+
* @since 4.0.0
|
|
345
345
|
*/
|
|
346
346
|
export const fromStep = <Input, Output, EnvX, Error, ErrorX, Env>(
|
|
347
347
|
step: Effect<
|
|
@@ -371,26 +371,25 @@ const metadataFn = () => {
|
|
|
371
371
|
/**
|
|
372
372
|
* Creates a Schedule from a step function that receives metadata about the schedule's execution.
|
|
373
373
|
*
|
|
374
|
-
*
|
|
375
|
-
* ```ts
|
|
376
|
-
* import { Effect, Schedule } from "effect"
|
|
374
|
+
* **Example** (Creating a metadata-aware schedule)
|
|
377
375
|
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
376
|
+
* ```ts
|
|
377
|
+
* import { Cause, Duration, Effect, Schedule } from "effect"
|
|
380
378
|
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
379
|
+
* const firstThreeInputs = Schedule.fromStepWithMetadata(Effect.succeed((metadata: Schedule.InputMetadata<string>) => {
|
|
380
|
+
* if (metadata.attempt > 3) {
|
|
381
|
+
* return Cause.done("finished")
|
|
382
|
+
* }
|
|
385
383
|
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
* )
|
|
384
|
+
* return Effect.succeed([
|
|
385
|
+
* `attempt ${metadata.attempt}: ${metadata.input}`,
|
|
386
|
+
* Duration.millis(250)
|
|
387
|
+
* ] as [string, Duration.Duration])
|
|
388
|
+
* }))
|
|
390
389
|
* ```
|
|
391
390
|
*
|
|
392
|
-
* @since 4.0.0
|
|
393
391
|
* @category constructors
|
|
392
|
+
* @since 4.0.0
|
|
394
393
|
*/
|
|
395
394
|
export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>(
|
|
396
395
|
step: Effect<
|
|
@@ -407,7 +406,8 @@ export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>(
|
|
|
407
406
|
/**
|
|
408
407
|
* Extracts the step function from a Schedule.
|
|
409
408
|
*
|
|
410
|
-
*
|
|
409
|
+
* **Example** (Extracting a schedule step function)
|
|
410
|
+
*
|
|
411
411
|
* ```ts
|
|
412
412
|
* import { Effect, Schedule } from "effect"
|
|
413
413
|
*
|
|
@@ -417,16 +417,17 @@ export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>(
|
|
|
417
417
|
* const program = Effect.gen(function*() {
|
|
418
418
|
* const stepFn = yield* Schedule.toStep(schedule)
|
|
419
419
|
*
|
|
420
|
-
* // Use the step function directly for custom logic
|
|
421
|
-
*
|
|
420
|
+
* // Use the step function directly for custom logic. The timestamp is
|
|
421
|
+
* // supplied by the caller, so tests can pass a deterministic value.
|
|
422
|
+
* const now = 0
|
|
422
423
|
* const result = yield* stepFn(now, "input")
|
|
423
424
|
*
|
|
424
425
|
* console.log(`Step result: ${result}`)
|
|
425
426
|
* })
|
|
426
427
|
* ```
|
|
427
428
|
*
|
|
428
|
-
* @since 4.0.0
|
|
429
429
|
* @category destructors
|
|
430
|
+
* @since 4.0.0
|
|
430
431
|
*/
|
|
431
432
|
export const toStep = <Output, Input, Error, Env>(
|
|
432
433
|
schedule: Schedule<Output, Input, Error, Env>
|
|
@@ -444,8 +445,8 @@ export const toStep = <Output, Input, Error, Env>(
|
|
|
444
445
|
* Extracts a step function from a Schedule that provides metadata about each
|
|
445
446
|
* execution. It will also handle sleeping for the computed delay.
|
|
446
447
|
*
|
|
447
|
-
* @since 4.0.0
|
|
448
448
|
* @category destructors
|
|
449
|
+
* @since 4.0.0
|
|
449
450
|
*/
|
|
450
451
|
export const toStepWithMetadata = <Output, Input, Error, Env>(
|
|
451
452
|
schedule: Schedule<Output, Input, Error, Env>
|
|
@@ -479,7 +480,8 @@ export const toStepWithMetadata = <Output, Input, Error, Env>(
|
|
|
479
480
|
/**
|
|
480
481
|
* Extracts a step function from a Schedule that automatically handles sleep delays.
|
|
481
482
|
*
|
|
482
|
-
*
|
|
483
|
+
* **Example** (Extracting a sleeping step function)
|
|
484
|
+
*
|
|
483
485
|
* ```ts
|
|
484
486
|
* import { Effect, Schedule } from "effect"
|
|
485
487
|
*
|
|
@@ -502,8 +504,8 @@ export const toStepWithMetadata = <Output, Input, Error, Env>(
|
|
|
502
504
|
* })
|
|
503
505
|
* ```
|
|
504
506
|
*
|
|
505
|
-
* @since 4.0.0
|
|
506
507
|
* @category destructors
|
|
508
|
+
* @since 4.0.0
|
|
507
509
|
*/
|
|
508
510
|
export const toStepWithSleep = <Output, Input, Error, Env>(
|
|
509
511
|
schedule: Schedule<Output, Input, Error, Env>
|
|
@@ -521,29 +523,26 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
|
|
|
521
523
|
* Returns a new `Schedule` that adds the delay computed by the specified
|
|
522
524
|
* effectful function to the the next recurrence of the schedule.
|
|
523
525
|
*
|
|
524
|
-
*
|
|
526
|
+
* **Example** (Adding extra delay to a schedule)
|
|
527
|
+
*
|
|
525
528
|
* ```ts
|
|
526
529
|
* import { Console, Data, Duration, Effect, Schedule } from "effect"
|
|
527
530
|
*
|
|
528
531
|
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
529
532
|
*
|
|
530
|
-
* // Add
|
|
531
|
-
* const
|
|
533
|
+
* // Add a deterministic extra delay based on the schedule output
|
|
534
|
+
* const delayedSchedule = Schedule.addDelay(
|
|
532
535
|
* Schedule.exponential("100 millis").pipe(Schedule.take(5)),
|
|
533
536
|
* (output) =>
|
|
534
|
-
*
|
|
535
|
-
* Effect.succeed(Duration.millis(Math.random() * 50))
|
|
537
|
+
* Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
|
|
536
538
|
* )
|
|
537
539
|
*
|
|
538
|
-
* const
|
|
540
|
+
* const repeatProgram = Effect.gen(function*() {
|
|
539
541
|
* yield* Effect.repeat(
|
|
540
|
-
* Effect.
|
|
541
|
-
*
|
|
542
|
-
* return "jittered task"
|
|
543
|
-
* }),
|
|
544
|
-
* jitteredSchedule.pipe(
|
|
542
|
+
* Effect.succeed("delayed task"),
|
|
543
|
+
* delayedSchedule.pipe(
|
|
545
544
|
* Schedule.tapOutput((delay) =>
|
|
546
|
-
* Console.log(`Base delay
|
|
545
|
+
* Console.log(`Base delay: ${delay}`)
|
|
547
546
|
* )
|
|
548
547
|
* )
|
|
549
548
|
* )
|
|
@@ -571,12 +570,15 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
|
|
|
571
570
|
* )
|
|
572
571
|
* })
|
|
573
572
|
*
|
|
574
|
-
* // Add effectful delay computation
|
|
573
|
+
* // Add effectful delay computation from deterministic service data
|
|
574
|
+
* const loadByExecution = [1, 3, 2, 4] as const
|
|
575
|
+
*
|
|
575
576
|
* const dynamicSchedule = Schedule.addDelay(
|
|
576
577
|
* Schedule.spaced("1 second").pipe(Schedule.take(4)),
|
|
577
|
-
* (executionNumber) =>
|
|
578
|
-
*
|
|
579
|
-
* Effect.succeed(Duration.millis(
|
|
578
|
+
* (executionNumber) => {
|
|
579
|
+
* const load = loadByExecution[executionNumber] ?? 1
|
|
580
|
+
* return Effect.succeed(Duration.millis(load * 100))
|
|
581
|
+
* }
|
|
580
582
|
* )
|
|
581
583
|
*
|
|
582
584
|
* const dynamicProgram = Effect.gen(function*() {
|
|
@@ -589,25 +591,6 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
|
|
|
589
591
|
* )
|
|
590
592
|
* })
|
|
591
593
|
*
|
|
592
|
-
* // Add delay based on previous execution results (30% extra)
|
|
593
|
-
* const resultBasedSchedule = Schedule.addDelay(
|
|
594
|
-
* Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
|
|
595
|
-
* (fibonacciDelay) =>
|
|
596
|
-
* Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
|
|
597
|
-
* )
|
|
598
|
-
*
|
|
599
|
-
* const resultProgram = Effect.gen(function*() {
|
|
600
|
-
* yield* Effect.repeat(
|
|
601
|
-
* Effect.gen(function*() {
|
|
602
|
-
* yield* Console.log("Result-based delay task")
|
|
603
|
-
* return Math.random()
|
|
604
|
-
* }),
|
|
605
|
-
* resultBasedSchedule.pipe(
|
|
606
|
-
* Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
|
|
607
|
-
* )
|
|
608
|
-
* )
|
|
609
|
-
* })
|
|
610
|
-
*
|
|
611
594
|
* // Combine with retry for progressive backoff
|
|
612
595
|
* const progressiveRetrySchedule = Schedule.addDelay(
|
|
613
596
|
* Schedule.exponential("50 millis").pipe(Schedule.take(4)),
|
|
@@ -632,37 +615,34 @@ export const toStepWithSleep = <Output, Input, Error, Env>(
|
|
|
632
615
|
* })
|
|
633
616
|
* ```
|
|
634
617
|
*
|
|
635
|
-
* @since 2.0.0
|
|
636
618
|
* @category utils
|
|
619
|
+
* @since 2.0.0
|
|
637
620
|
*/
|
|
638
621
|
export const addDelay: {
|
|
639
622
|
/**
|
|
640
623
|
* Returns a new `Schedule` that adds the delay computed by the specified
|
|
641
624
|
* effectful function to the the next recurrence of the schedule.
|
|
642
625
|
*
|
|
643
|
-
*
|
|
626
|
+
* **Example** (Adding extra delay to a schedule)
|
|
627
|
+
*
|
|
644
628
|
* ```ts
|
|
645
629
|
* import { Console, Data, Duration, Effect, Schedule } from "effect"
|
|
646
630
|
*
|
|
647
631
|
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
648
632
|
*
|
|
649
|
-
* // Add
|
|
650
|
-
* const
|
|
633
|
+
* // Add a deterministic extra delay based on the schedule output
|
|
634
|
+
* const delayedSchedule = Schedule.addDelay(
|
|
651
635
|
* Schedule.exponential("100 millis").pipe(Schedule.take(5)),
|
|
652
636
|
* (output) =>
|
|
653
|
-
*
|
|
654
|
-
* Effect.succeed(Duration.millis(Math.random() * 50))
|
|
637
|
+
* Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
|
|
655
638
|
* )
|
|
656
639
|
*
|
|
657
|
-
* const
|
|
640
|
+
* const repeatProgram = Effect.gen(function*() {
|
|
658
641
|
* yield* Effect.repeat(
|
|
659
|
-
* Effect.
|
|
660
|
-
*
|
|
661
|
-
* return "jittered task"
|
|
662
|
-
* }),
|
|
663
|
-
* jitteredSchedule.pipe(
|
|
642
|
+
* Effect.succeed("delayed task"),
|
|
643
|
+
* delayedSchedule.pipe(
|
|
664
644
|
* Schedule.tapOutput((delay) =>
|
|
665
|
-
* Console.log(`Base delay
|
|
645
|
+
* Console.log(`Base delay: ${delay}`)
|
|
666
646
|
* )
|
|
667
647
|
* )
|
|
668
648
|
* )
|
|
@@ -690,12 +670,15 @@ export const addDelay: {
|
|
|
690
670
|
* )
|
|
691
671
|
* })
|
|
692
672
|
*
|
|
693
|
-
* // Add effectful delay computation
|
|
673
|
+
* // Add effectful delay computation from deterministic service data
|
|
674
|
+
* const loadByExecution = [1, 3, 2, 4] as const
|
|
675
|
+
*
|
|
694
676
|
* const dynamicSchedule = Schedule.addDelay(
|
|
695
677
|
* Schedule.spaced("1 second").pipe(Schedule.take(4)),
|
|
696
|
-
* (executionNumber) =>
|
|
697
|
-
*
|
|
698
|
-
* Effect.succeed(Duration.millis(
|
|
678
|
+
* (executionNumber) => {
|
|
679
|
+
* const load = loadByExecution[executionNumber] ?? 1
|
|
680
|
+
* return Effect.succeed(Duration.millis(load * 100))
|
|
681
|
+
* }
|
|
699
682
|
* )
|
|
700
683
|
*
|
|
701
684
|
* const dynamicProgram = Effect.gen(function*() {
|
|
@@ -708,25 +691,6 @@ export const addDelay: {
|
|
|
708
691
|
* )
|
|
709
692
|
* })
|
|
710
693
|
*
|
|
711
|
-
* // Add delay based on previous execution results (30% extra)
|
|
712
|
-
* const resultBasedSchedule = Schedule.addDelay(
|
|
713
|
-
* Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
|
|
714
|
-
* (fibonacciDelay) =>
|
|
715
|
-
* Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
|
|
716
|
-
* )
|
|
717
|
-
*
|
|
718
|
-
* const resultProgram = Effect.gen(function*() {
|
|
719
|
-
* yield* Effect.repeat(
|
|
720
|
-
* Effect.gen(function*() {
|
|
721
|
-
* yield* Console.log("Result-based delay task")
|
|
722
|
-
* return Math.random()
|
|
723
|
-
* }),
|
|
724
|
-
* resultBasedSchedule.pipe(
|
|
725
|
-
* Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
|
|
726
|
-
* )
|
|
727
|
-
* )
|
|
728
|
-
* })
|
|
729
|
-
*
|
|
730
694
|
* // Combine with retry for progressive backoff
|
|
731
695
|
* const progressiveRetrySchedule = Schedule.addDelay(
|
|
732
696
|
* Schedule.exponential("50 millis").pipe(Schedule.take(4)),
|
|
@@ -751,8 +715,8 @@ export const addDelay: {
|
|
|
751
715
|
* })
|
|
752
716
|
* ```
|
|
753
717
|
*
|
|
754
|
-
* @since 2.0.0
|
|
755
718
|
* @category utils
|
|
719
|
+
* @since 2.0.0
|
|
756
720
|
*/
|
|
757
721
|
<Output, Error2 = never, Env2 = never>(f: (output: Output) => Effect<Duration.Input, Error2, Env2>): <Input, Error, Env>(
|
|
758
722
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -761,29 +725,26 @@ export const addDelay: {
|
|
|
761
725
|
* Returns a new `Schedule` that adds the delay computed by the specified
|
|
762
726
|
* effectful function to the the next recurrence of the schedule.
|
|
763
727
|
*
|
|
764
|
-
*
|
|
728
|
+
* **Example** (Adding extra delay to a schedule)
|
|
729
|
+
*
|
|
765
730
|
* ```ts
|
|
766
731
|
* import { Console, Data, Duration, Effect, Schedule } from "effect"
|
|
767
732
|
*
|
|
768
733
|
* class RetryAttemptError extends Data.TaggedError("RetryAttemptError")<{ readonly message: string }> {}
|
|
769
734
|
*
|
|
770
|
-
* // Add
|
|
771
|
-
* const
|
|
735
|
+
* // Add a deterministic extra delay based on the schedule output
|
|
736
|
+
* const delayedSchedule = Schedule.addDelay(
|
|
772
737
|
* Schedule.exponential("100 millis").pipe(Schedule.take(5)),
|
|
773
738
|
* (output) =>
|
|
774
|
-
*
|
|
775
|
-
* Effect.succeed(Duration.millis(Math.random() * 50))
|
|
739
|
+
* Effect.succeed(Duration.millis(Duration.toMillis(output) * 0.25))
|
|
776
740
|
* )
|
|
777
741
|
*
|
|
778
|
-
* const
|
|
742
|
+
* const repeatProgram = Effect.gen(function*() {
|
|
779
743
|
* yield* Effect.repeat(
|
|
780
|
-
* Effect.
|
|
781
|
-
*
|
|
782
|
-
* return "jittered task"
|
|
783
|
-
* }),
|
|
784
|
-
* jitteredSchedule.pipe(
|
|
744
|
+
* Effect.succeed("delayed task"),
|
|
745
|
+
* delayedSchedule.pipe(
|
|
785
746
|
* Schedule.tapOutput((delay) =>
|
|
786
|
-
* Console.log(`Base delay
|
|
747
|
+
* Console.log(`Base delay: ${delay}`)
|
|
787
748
|
* )
|
|
788
749
|
* )
|
|
789
750
|
* )
|
|
@@ -811,12 +772,15 @@ export const addDelay: {
|
|
|
811
772
|
* )
|
|
812
773
|
* })
|
|
813
774
|
*
|
|
814
|
-
* // Add effectful delay computation
|
|
775
|
+
* // Add effectful delay computation from deterministic service data
|
|
776
|
+
* const loadByExecution = [1, 3, 2, 4] as const
|
|
777
|
+
*
|
|
815
778
|
* const dynamicSchedule = Schedule.addDelay(
|
|
816
779
|
* Schedule.spaced("1 second").pipe(Schedule.take(4)),
|
|
817
|
-
* (executionNumber) =>
|
|
818
|
-
*
|
|
819
|
-
* Effect.succeed(Duration.millis(
|
|
780
|
+
* (executionNumber) => {
|
|
781
|
+
* const load = loadByExecution[executionNumber] ?? 1
|
|
782
|
+
* return Effect.succeed(Duration.millis(load * 100))
|
|
783
|
+
* }
|
|
820
784
|
* )
|
|
821
785
|
*
|
|
822
786
|
* const dynamicProgram = Effect.gen(function*() {
|
|
@@ -829,25 +793,6 @@ export const addDelay: {
|
|
|
829
793
|
* )
|
|
830
794
|
* })
|
|
831
795
|
*
|
|
832
|
-
* // Add delay based on previous execution results (30% extra)
|
|
833
|
-
* const resultBasedSchedule = Schedule.addDelay(
|
|
834
|
-
* Schedule.fibonacci("200 millis").pipe(Schedule.take(5)),
|
|
835
|
-
* (fibonacciDelay) =>
|
|
836
|
-
* Effect.succeed(Duration.millis(Duration.toMillis(fibonacciDelay) * 0.3))
|
|
837
|
-
* )
|
|
838
|
-
*
|
|
839
|
-
* const resultProgram = Effect.gen(function*() {
|
|
840
|
-
* yield* Effect.repeat(
|
|
841
|
-
* Effect.gen(function*() {
|
|
842
|
-
* yield* Console.log("Result-based delay task")
|
|
843
|
-
* return Math.random()
|
|
844
|
-
* }),
|
|
845
|
-
* resultBasedSchedule.pipe(
|
|
846
|
-
* Schedule.tapOutput((delay) => Console.log(`Fibonacci delay: ${delay}`))
|
|
847
|
-
* )
|
|
848
|
-
* )
|
|
849
|
-
* })
|
|
850
|
-
*
|
|
851
796
|
* // Combine with retry for progressive backoff
|
|
852
797
|
* const progressiveRetrySchedule = Schedule.addDelay(
|
|
853
798
|
* Schedule.exponential("50 millis").pipe(Schedule.take(4)),
|
|
@@ -872,8 +817,8 @@ export const addDelay: {
|
|
|
872
817
|
* })
|
|
873
818
|
* ```
|
|
874
819
|
*
|
|
875
|
-
* @since 2.0.0
|
|
876
820
|
* @category utils
|
|
821
|
+
* @since 2.0.0
|
|
877
822
|
*/
|
|
878
823
|
<Output, Input, Error, Env, Error2 = never, Env2 = never>(
|
|
879
824
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -894,7 +839,8 @@ export const addDelay: {
|
|
|
894
839
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
895
840
|
* `other`) schedule will be executed to completion.
|
|
896
841
|
*
|
|
897
|
-
*
|
|
842
|
+
* **Example** (Sequencing quick and slow retries)
|
|
843
|
+
*
|
|
898
844
|
* ```ts
|
|
899
845
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
900
846
|
*
|
|
@@ -926,8 +872,8 @@ export const addDelay: {
|
|
|
926
872
|
* })
|
|
927
873
|
* ```
|
|
928
874
|
*
|
|
929
|
-
* @since 2.0.0
|
|
930
875
|
* @category sequencing
|
|
876
|
+
* @since 2.0.0
|
|
931
877
|
*/
|
|
932
878
|
export const andThen: {
|
|
933
879
|
/**
|
|
@@ -935,7 +881,8 @@ export const andThen: {
|
|
|
935
881
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
936
882
|
* `other`) schedule will be executed to completion.
|
|
937
883
|
*
|
|
938
|
-
*
|
|
884
|
+
* **Example** (Sequencing quick and slow retries)
|
|
885
|
+
*
|
|
939
886
|
* ```ts
|
|
940
887
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
941
888
|
*
|
|
@@ -967,8 +914,8 @@ export const andThen: {
|
|
|
967
914
|
* })
|
|
968
915
|
* ```
|
|
969
916
|
*
|
|
970
|
-
* @since 2.0.0
|
|
971
917
|
* @category sequencing
|
|
918
|
+
* @since 2.0.0
|
|
972
919
|
*/
|
|
973
920
|
<Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
|
|
974
921
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -978,7 +925,8 @@ export const andThen: {
|
|
|
978
925
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
979
926
|
* `other`) schedule will be executed to completion.
|
|
980
927
|
*
|
|
981
|
-
*
|
|
928
|
+
* **Example** (Sequencing quick and slow retries)
|
|
929
|
+
*
|
|
982
930
|
* ```ts
|
|
983
931
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
984
932
|
*
|
|
@@ -1010,8 +958,8 @@ export const andThen: {
|
|
|
1010
958
|
* })
|
|
1011
959
|
* ```
|
|
1012
960
|
*
|
|
1013
|
-
* @since 2.0.0
|
|
1014
961
|
* @category sequencing
|
|
962
|
+
* @since 2.0.0
|
|
1015
963
|
*/
|
|
1016
964
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
1017
965
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -1028,11 +976,12 @@ export const andThen: {
|
|
|
1028
976
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
1029
977
|
* `other`) schedule will be executed to completion.
|
|
1030
978
|
*
|
|
1031
|
-
* The
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
979
|
+
* The resulting schedule emits a `Result` to indicate which phase produced
|
|
980
|
+
* each output: outputs from `self` are emitted as `Failure`, and outputs from
|
|
981
|
+
* `other` are emitted as `Success`.
|
|
982
|
+
*
|
|
983
|
+
* **Example** (Tracking sequential schedule phases)
|
|
1034
984
|
*
|
|
1035
|
-
* @example
|
|
1036
985
|
* ```ts
|
|
1037
986
|
* import { Console, Effect, Result, Schedule } from "effect"
|
|
1038
987
|
*
|
|
@@ -1060,8 +1009,8 @@ export const andThen: {
|
|
|
1060
1009
|
* })
|
|
1061
1010
|
* ```
|
|
1062
1011
|
*
|
|
1063
|
-
* @since 2.0.0
|
|
1064
1012
|
* @category sequencing
|
|
1013
|
+
* @since 4.0.0
|
|
1065
1014
|
*/
|
|
1066
1015
|
export const andThenResult: {
|
|
1067
1016
|
/**
|
|
@@ -1069,11 +1018,12 @@ export const andThenResult: {
|
|
|
1069
1018
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
1070
1019
|
* `other`) schedule will be executed to completion.
|
|
1071
1020
|
*
|
|
1072
|
-
* The
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1021
|
+
* The resulting schedule emits a `Result` to indicate which phase produced
|
|
1022
|
+
* each output: outputs from `self` are emitted as `Failure`, and outputs from
|
|
1023
|
+
* `other` are emitted as `Success`.
|
|
1024
|
+
*
|
|
1025
|
+
* **Example** (Tracking sequential schedule phases)
|
|
1075
1026
|
*
|
|
1076
|
-
* @example
|
|
1077
1027
|
* ```ts
|
|
1078
1028
|
* import { Console, Effect, Result, Schedule } from "effect"
|
|
1079
1029
|
*
|
|
@@ -1101,8 +1051,8 @@ export const andThenResult: {
|
|
|
1101
1051
|
* })
|
|
1102
1052
|
* ```
|
|
1103
1053
|
*
|
|
1104
|
-
* @since 2.0.0
|
|
1105
1054
|
* @category sequencing
|
|
1055
|
+
* @since 4.0.0
|
|
1106
1056
|
*/
|
|
1107
1057
|
<Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
|
|
1108
1058
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -1112,11 +1062,12 @@ export const andThenResult: {
|
|
|
1112
1062
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
1113
1063
|
* `other`) schedule will be executed to completion.
|
|
1114
1064
|
*
|
|
1115
|
-
* The
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
1065
|
+
* The resulting schedule emits a `Result` to indicate which phase produced
|
|
1066
|
+
* each output: outputs from `self` are emitted as `Failure`, and outputs from
|
|
1067
|
+
* `other` are emitted as `Success`.
|
|
1068
|
+
*
|
|
1069
|
+
* **Example** (Tracking sequential schedule phases)
|
|
1118
1070
|
*
|
|
1119
|
-
* @example
|
|
1120
1071
|
* ```ts
|
|
1121
1072
|
* import { Console, Effect, Result, Schedule } from "effect"
|
|
1122
1073
|
*
|
|
@@ -1144,8 +1095,8 @@ export const andThenResult: {
|
|
|
1144
1095
|
* })
|
|
1145
1096
|
* ```
|
|
1146
1097
|
*
|
|
1147
|
-
* @since 2.0.0
|
|
1148
1098
|
* @category sequencing
|
|
1099
|
+
* @since 4.0.0
|
|
1149
1100
|
*/
|
|
1150
1101
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
1151
1102
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -1183,11 +1134,12 @@ export const andThenResult: {
|
|
|
1183
1134
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
1184
1135
|
* `other`) schedule will be executed to completion.
|
|
1185
1136
|
*
|
|
1186
|
-
* The
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1137
|
+
* The resulting schedule emits a `Result` to indicate which phase produced
|
|
1138
|
+
* each output: outputs from `self` are emitted as `Failure`, and outputs from
|
|
1139
|
+
* `other` are emitted as `Success`.
|
|
1140
|
+
*
|
|
1141
|
+
* **Example** (Tracking sequential schedule phases)
|
|
1189
1142
|
*
|
|
1190
|
-
* @example
|
|
1191
1143
|
* ```ts
|
|
1192
1144
|
* import { Console, Effect, Result, Schedule } from "effect"
|
|
1193
1145
|
*
|
|
@@ -1215,8 +1167,8 @@ export const andThenResult: {
|
|
|
1215
1167
|
* })
|
|
1216
1168
|
* ```
|
|
1217
1169
|
*
|
|
1218
|
-
* @since 2.0.0
|
|
1219
1170
|
* @category sequencing
|
|
1171
|
+
* @since 4.0.0
|
|
1220
1172
|
*/
|
|
1221
1173
|
Result.Result<Output, Output2>,
|
|
1222
1174
|
/**
|
|
@@ -1224,11 +1176,12 @@ export const andThenResult: {
|
|
|
1224
1176
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
1225
1177
|
* `other`) schedule will be executed to completion.
|
|
1226
1178
|
*
|
|
1227
|
-
* The
|
|
1228
|
-
*
|
|
1229
|
-
*
|
|
1179
|
+
* The resulting schedule emits a `Result` to indicate which phase produced
|
|
1180
|
+
* each output: outputs from `self` are emitted as `Failure`, and outputs from
|
|
1181
|
+
* `other` are emitted as `Success`.
|
|
1182
|
+
*
|
|
1183
|
+
* **Example** (Tracking sequential schedule phases)
|
|
1230
1184
|
*
|
|
1231
|
-
* @example
|
|
1232
1185
|
* ```ts
|
|
1233
1186
|
* import { Console, Effect, Result, Schedule } from "effect"
|
|
1234
1187
|
*
|
|
@@ -1256,8 +1209,8 @@ export const andThenResult: {
|
|
|
1256
1209
|
* })
|
|
1257
1210
|
* ```
|
|
1258
1211
|
*
|
|
1259
|
-
* @since 2.0.0
|
|
1260
1212
|
* @category sequencing
|
|
1213
|
+
* @since 4.0.0
|
|
1261
1214
|
*/
|
|
1262
1215
|
Input & Input2,
|
|
1263
1216
|
/**
|
|
@@ -1265,11 +1218,12 @@ export const andThenResult: {
|
|
|
1265
1218
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
1266
1219
|
* `other`) schedule will be executed to completion.
|
|
1267
1220
|
*
|
|
1268
|
-
* The
|
|
1269
|
-
*
|
|
1270
|
-
*
|
|
1221
|
+
* The resulting schedule emits a `Result` to indicate which phase produced
|
|
1222
|
+
* each output: outputs from `self` are emitted as `Failure`, and outputs from
|
|
1223
|
+
* `other` are emitted as `Success`.
|
|
1224
|
+
*
|
|
1225
|
+
* **Example** (Tracking sequential schedule phases)
|
|
1271
1226
|
*
|
|
1272
|
-
* @example
|
|
1273
1227
|
* ```ts
|
|
1274
1228
|
* import { Console, Effect, Result, Schedule } from "effect"
|
|
1275
1229
|
*
|
|
@@ -1297,8 +1251,8 @@ export const andThenResult: {
|
|
|
1297
1251
|
* })
|
|
1298
1252
|
* ```
|
|
1299
1253
|
*
|
|
1300
|
-
* @since 2.0.0
|
|
1301
1254
|
* @category sequencing
|
|
1255
|
+
* @since 4.0.0
|
|
1302
1256
|
*/
|
|
1303
1257
|
Error | Error2,
|
|
1304
1258
|
/**
|
|
@@ -1306,11 +1260,12 @@ export const andThenResult: {
|
|
|
1306
1260
|
* schedule to completion. Once the left schedule is complete, the right (i.e.
|
|
1307
1261
|
* `other`) schedule will be executed to completion.
|
|
1308
1262
|
*
|
|
1309
|
-
* The
|
|
1310
|
-
*
|
|
1311
|
-
*
|
|
1263
|
+
* The resulting schedule emits a `Result` to indicate which phase produced
|
|
1264
|
+
* each output: outputs from `self` are emitted as `Failure`, and outputs from
|
|
1265
|
+
* `other` are emitted as `Success`.
|
|
1266
|
+
*
|
|
1267
|
+
* **Example** (Tracking sequential schedule phases)
|
|
1312
1268
|
*
|
|
1313
|
-
* @example
|
|
1314
1269
|
* ```ts
|
|
1315
1270
|
* import { Console, Effect, Result, Schedule } from "effect"
|
|
1316
1271
|
*
|
|
@@ -1338,8 +1293,8 @@ export const andThenResult: {
|
|
|
1338
1293
|
* })
|
|
1339
1294
|
* ```
|
|
1340
1295
|
*
|
|
1341
|
-
* @since 2.0.0
|
|
1342
1296
|
* @category sequencing
|
|
1297
|
+
* @since 4.0.0
|
|
1343
1298
|
*/
|
|
1344
1299
|
Env | Env2
|
|
1345
1300
|
>(currentSide === 0 ? left : right).pipe(
|
|
@@ -1365,7 +1320,8 @@ export const andThenResult: {
|
|
|
1365
1320
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1366
1321
|
* outputting a tuple of the outputs of both schedules.
|
|
1367
1322
|
*
|
|
1368
|
-
*
|
|
1323
|
+
* **Example** (Combining time and attempt limits)
|
|
1324
|
+
*
|
|
1369
1325
|
* ```ts
|
|
1370
1326
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1371
1327
|
*
|
|
@@ -1382,7 +1338,7 @@ export const andThenResult: {
|
|
|
1382
1338
|
* const program = Effect.gen(function*() {
|
|
1383
1339
|
* const results = yield* Effect.repeat(
|
|
1384
1340
|
* Effect.gen(function*() {
|
|
1385
|
-
* yield* Console.log(
|
|
1341
|
+
* yield* Console.log("Task executed")
|
|
1386
1342
|
* return "task completed"
|
|
1387
1343
|
* }),
|
|
1388
1344
|
* bothSchedule.pipe(
|
|
@@ -1426,8 +1382,8 @@ export const andThenResult: {
|
|
|
1426
1382
|
* // Compare with either which provides union semantics (OR logic)
|
|
1427
1383
|
* ```
|
|
1428
1384
|
*
|
|
1385
|
+
* @category utils
|
|
1429
1386
|
* @since 2.0.0
|
|
1430
|
-
* @category utilities
|
|
1431
1387
|
*/
|
|
1432
1388
|
export const both: {
|
|
1433
1389
|
/**
|
|
@@ -1435,7 +1391,8 @@ export const both: {
|
|
|
1435
1391
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1436
1392
|
* outputting a tuple of the outputs of both schedules.
|
|
1437
1393
|
*
|
|
1438
|
-
*
|
|
1394
|
+
* **Example** (Combining time and attempt limits)
|
|
1395
|
+
*
|
|
1439
1396
|
* ```ts
|
|
1440
1397
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1441
1398
|
*
|
|
@@ -1452,7 +1409,7 @@ export const both: {
|
|
|
1452
1409
|
* const program = Effect.gen(function*() {
|
|
1453
1410
|
* const results = yield* Effect.repeat(
|
|
1454
1411
|
* Effect.gen(function*() {
|
|
1455
|
-
* yield* Console.log(
|
|
1412
|
+
* yield* Console.log("Task executed")
|
|
1456
1413
|
* return "task completed"
|
|
1457
1414
|
* }),
|
|
1458
1415
|
* bothSchedule.pipe(
|
|
@@ -1496,8 +1453,8 @@ export const both: {
|
|
|
1496
1453
|
* // Compare with either which provides union semantics (OR logic)
|
|
1497
1454
|
* ```
|
|
1498
1455
|
*
|
|
1456
|
+
* @category utils
|
|
1499
1457
|
* @since 2.0.0
|
|
1500
|
-
* @category utilities
|
|
1501
1458
|
*/
|
|
1502
1459
|
<Output2, Input2, Error2, Env2, Output>(other: Schedule<Output2, Input2, Error2, Env2>): <Input, Error, Env>(
|
|
1503
1460
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -1507,7 +1464,8 @@ export const both: {
|
|
|
1507
1464
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1508
1465
|
* outputting a tuple of the outputs of both schedules.
|
|
1509
1466
|
*
|
|
1510
|
-
*
|
|
1467
|
+
* **Example** (Combining time and attempt limits)
|
|
1468
|
+
*
|
|
1511
1469
|
* ```ts
|
|
1512
1470
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
1513
1471
|
*
|
|
@@ -1524,7 +1482,7 @@ export const both: {
|
|
|
1524
1482
|
* const program = Effect.gen(function*() {
|
|
1525
1483
|
* const results = yield* Effect.repeat(
|
|
1526
1484
|
* Effect.gen(function*() {
|
|
1527
|
-
* yield* Console.log(
|
|
1485
|
+
* yield* Console.log("Task executed")
|
|
1528
1486
|
* return "task completed"
|
|
1529
1487
|
* }),
|
|
1530
1488
|
* bothSchedule.pipe(
|
|
@@ -1568,8 +1526,8 @@ export const both: {
|
|
|
1568
1526
|
* // Compare with either which provides union semantics (OR logic)
|
|
1569
1527
|
* ```
|
|
1570
1528
|
*
|
|
1529
|
+
* @category utils
|
|
1571
1530
|
* @since 2.0.0
|
|
1572
|
-
* @category utilities
|
|
1573
1531
|
*/
|
|
1574
1532
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
1575
1533
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -1586,7 +1544,8 @@ export const both: {
|
|
|
1586
1544
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1587
1545
|
* outputting the result of the left schedule (i.e. `self`).
|
|
1588
1546
|
*
|
|
1589
|
-
*
|
|
1547
|
+
* **Example** (Combining schedules and keeping the left output)
|
|
1548
|
+
*
|
|
1590
1549
|
* ```ts
|
|
1591
1550
|
* import { Console, Effect, Schedule } from "effect"
|
|
1592
1551
|
*
|
|
@@ -1609,8 +1568,8 @@ export const both: {
|
|
|
1609
1568
|
* })
|
|
1610
1569
|
* ```
|
|
1611
1570
|
*
|
|
1571
|
+
* @category utils
|
|
1612
1572
|
* @since 2.0.0
|
|
1613
|
-
* @category utilities
|
|
1614
1573
|
*/
|
|
1615
1574
|
export const bothLeft: {
|
|
1616
1575
|
/**
|
|
@@ -1618,7 +1577,8 @@ export const bothLeft: {
|
|
|
1618
1577
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1619
1578
|
* outputting the result of the left schedule (i.e. `self`).
|
|
1620
1579
|
*
|
|
1621
|
-
*
|
|
1580
|
+
* **Example** (Combining schedules and keeping the left output)
|
|
1581
|
+
*
|
|
1622
1582
|
* ```ts
|
|
1623
1583
|
* import { Console, Effect, Schedule } from "effect"
|
|
1624
1584
|
*
|
|
@@ -1641,8 +1601,8 @@ export const bothLeft: {
|
|
|
1641
1601
|
* })
|
|
1642
1602
|
* ```
|
|
1643
1603
|
*
|
|
1604
|
+
* @category utils
|
|
1644
1605
|
* @since 2.0.0
|
|
1645
|
-
* @category utilities
|
|
1646
1606
|
*/
|
|
1647
1607
|
<Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
|
|
1648
1608
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -1652,7 +1612,8 @@ export const bothLeft: {
|
|
|
1652
1612
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1653
1613
|
* outputting the result of the left schedule (i.e. `self`).
|
|
1654
1614
|
*
|
|
1655
|
-
*
|
|
1615
|
+
* **Example** (Combining schedules and keeping the left output)
|
|
1616
|
+
*
|
|
1656
1617
|
* ```ts
|
|
1657
1618
|
* import { Console, Effect, Schedule } from "effect"
|
|
1658
1619
|
*
|
|
@@ -1675,8 +1636,8 @@ export const bothLeft: {
|
|
|
1675
1636
|
* })
|
|
1676
1637
|
* ```
|
|
1677
1638
|
*
|
|
1639
|
+
* @category utils
|
|
1678
1640
|
* @since 2.0.0
|
|
1679
|
-
* @category utilities
|
|
1680
1641
|
*/
|
|
1681
1642
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
1682
1643
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -1692,7 +1653,8 @@ export const bothLeft: {
|
|
|
1692
1653
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1693
1654
|
* outputting the result of the right schedule (i.e. `other`).
|
|
1694
1655
|
*
|
|
1695
|
-
*
|
|
1656
|
+
* **Example** (Combining schedules and keeping the right output)
|
|
1657
|
+
*
|
|
1696
1658
|
* ```ts
|
|
1697
1659
|
* import { Console, Effect, Schedule } from "effect"
|
|
1698
1660
|
*
|
|
@@ -1717,8 +1679,8 @@ export const bothLeft: {
|
|
|
1717
1679
|
* })
|
|
1718
1680
|
* ```
|
|
1719
1681
|
*
|
|
1682
|
+
* @category utils
|
|
1720
1683
|
* @since 2.0.0
|
|
1721
|
-
* @category utilities
|
|
1722
1684
|
*/
|
|
1723
1685
|
export const bothRight: {
|
|
1724
1686
|
/**
|
|
@@ -1726,7 +1688,8 @@ export const bothRight: {
|
|
|
1726
1688
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1727
1689
|
* outputting the result of the right schedule (i.e. `other`).
|
|
1728
1690
|
*
|
|
1729
|
-
*
|
|
1691
|
+
* **Example** (Combining schedules and keeping the right output)
|
|
1692
|
+
*
|
|
1730
1693
|
* ```ts
|
|
1731
1694
|
* import { Console, Effect, Schedule } from "effect"
|
|
1732
1695
|
*
|
|
@@ -1751,8 +1714,8 @@ export const bothRight: {
|
|
|
1751
1714
|
* })
|
|
1752
1715
|
* ```
|
|
1753
1716
|
*
|
|
1717
|
+
* @category utils
|
|
1754
1718
|
* @since 2.0.0
|
|
1755
|
-
* @category utilities
|
|
1756
1719
|
*/
|
|
1757
1720
|
<Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
|
|
1758
1721
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -1762,7 +1725,8 @@ export const bothRight: {
|
|
|
1762
1725
|
* to recur, using the maximum of the two durations between recurrences and
|
|
1763
1726
|
* outputting the result of the right schedule (i.e. `other`).
|
|
1764
1727
|
*
|
|
1765
|
-
*
|
|
1728
|
+
* **Example** (Combining schedules and keeping the right output)
|
|
1729
|
+
*
|
|
1766
1730
|
* ```ts
|
|
1767
1731
|
* import { Console, Effect, Schedule } from "effect"
|
|
1768
1732
|
*
|
|
@@ -1787,8 +1751,8 @@ export const bothRight: {
|
|
|
1787
1751
|
* })
|
|
1788
1752
|
* ```
|
|
1789
1753
|
*
|
|
1754
|
+
* @category utils
|
|
1790
1755
|
* @since 2.0.0
|
|
1791
|
-
* @category utilities
|
|
1792
1756
|
*/
|
|
1793
1757
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
1794
1758
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -1805,7 +1769,8 @@ export const bothRight: {
|
|
|
1805
1769
|
* outputting the result of the combination of both schedule outputs using the
|
|
1806
1770
|
* specified `combine` function.
|
|
1807
1771
|
*
|
|
1808
|
-
*
|
|
1772
|
+
* **Example** (Combining schedule outputs)
|
|
1773
|
+
*
|
|
1809
1774
|
* ```ts
|
|
1810
1775
|
* import { Console, Effect, Schedule } from "effect"
|
|
1811
1776
|
*
|
|
@@ -1834,8 +1799,8 @@ export const bothRight: {
|
|
|
1834
1799
|
* })
|
|
1835
1800
|
* ```
|
|
1836
1801
|
*
|
|
1802
|
+
* @category utils
|
|
1837
1803
|
* @since 2.0.0
|
|
1838
|
-
* @category utilities
|
|
1839
1804
|
*/
|
|
1840
1805
|
export const bothWith: {
|
|
1841
1806
|
/**
|
|
@@ -1844,7 +1809,8 @@ export const bothWith: {
|
|
|
1844
1809
|
* outputting the result of the combination of both schedule outputs using the
|
|
1845
1810
|
* specified `combine` function.
|
|
1846
1811
|
*
|
|
1847
|
-
*
|
|
1812
|
+
* **Example** (Combining schedule outputs)
|
|
1813
|
+
*
|
|
1848
1814
|
* ```ts
|
|
1849
1815
|
* import { Console, Effect, Schedule } from "effect"
|
|
1850
1816
|
*
|
|
@@ -1873,8 +1839,8 @@ export const bothWith: {
|
|
|
1873
1839
|
* })
|
|
1874
1840
|
* ```
|
|
1875
1841
|
*
|
|
1842
|
+
* @category utils
|
|
1876
1843
|
* @since 2.0.0
|
|
1877
|
-
* @category utilities
|
|
1878
1844
|
*/
|
|
1879
1845
|
<Output2, Input2, Error2, Env2, Output, Output3>(
|
|
1880
1846
|
other: Schedule<Output2, Input2, Error2, Env2>,
|
|
@@ -1888,7 +1854,8 @@ export const bothWith: {
|
|
|
1888
1854
|
* outputting the result of the combination of both schedule outputs using the
|
|
1889
1855
|
* specified `combine` function.
|
|
1890
1856
|
*
|
|
1891
|
-
*
|
|
1857
|
+
* **Example** (Combining schedule outputs)
|
|
1858
|
+
*
|
|
1892
1859
|
* ```ts
|
|
1893
1860
|
* import { Console, Effect, Schedule } from "effect"
|
|
1894
1861
|
*
|
|
@@ -1917,8 +1884,8 @@ export const bothWith: {
|
|
|
1917
1884
|
* })
|
|
1918
1885
|
* ```
|
|
1919
1886
|
*
|
|
1887
|
+
* @category utils
|
|
1920
1888
|
* @since 2.0.0
|
|
1921
|
-
* @category utilities
|
|
1922
1889
|
*/
|
|
1923
1890
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2, Output3>(
|
|
1924
1891
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -1954,10 +1921,15 @@ export const bothWith: {
|
|
|
1954
1921
|
)))
|
|
1955
1922
|
|
|
1956
1923
|
/**
|
|
1957
|
-
* Returns a new `Schedule` that
|
|
1958
|
-
*
|
|
1924
|
+
* Returns a new `Schedule` that follows `self` and outputs the inputs seen so
|
|
1925
|
+
* far as an array.
|
|
1926
|
+
*
|
|
1927
|
+
* **Details**
|
|
1928
|
+
* This does not make the schedule run forever. The collected schedule stops
|
|
1929
|
+
* when `self` stops and fails when `self` fails.
|
|
1930
|
+
*
|
|
1931
|
+
* **Example** (Collecting schedule inputs)
|
|
1959
1932
|
*
|
|
1960
|
-
* @example
|
|
1961
1933
|
* ```ts
|
|
1962
1934
|
* import { Console, Effect, Schedule } from "effect"
|
|
1963
1935
|
*
|
|
@@ -1979,18 +1951,23 @@ export const bothWith: {
|
|
|
1979
1951
|
* })
|
|
1980
1952
|
* ```
|
|
1981
1953
|
*
|
|
1982
|
-
* @
|
|
1983
|
-
* @
|
|
1954
|
+
* @category utils
|
|
1955
|
+
* @since 4.0.0
|
|
1984
1956
|
*/
|
|
1985
1957
|
export const collectInputs = <Output, Input, Error, Env>(
|
|
1986
1958
|
self: Schedule<Output, Input, Error, Env>
|
|
1987
1959
|
): Schedule<Array<Input>, Input, Error, Env> => collectWhile(passthrough(self), () => effect.succeed(true))
|
|
1988
1960
|
|
|
1989
1961
|
/**
|
|
1990
|
-
* Returns a new `Schedule` that
|
|
1991
|
-
*
|
|
1962
|
+
* Returns a new `Schedule` that follows `self` and outputs the schedule outputs
|
|
1963
|
+
* seen so far as an array.
|
|
1964
|
+
*
|
|
1965
|
+
* **Details**
|
|
1966
|
+
* This does not make the schedule run forever. The collected schedule stops
|
|
1967
|
+
* when `self` stops and fails when `self` fails.
|
|
1968
|
+
*
|
|
1969
|
+
* **Example** (Collecting schedule outputs)
|
|
1992
1970
|
*
|
|
1993
|
-
* @example
|
|
1994
1971
|
* ```ts
|
|
1995
1972
|
* import { Console, Effect, Schedule } from "effect"
|
|
1996
1973
|
*
|
|
@@ -2010,8 +1987,8 @@ export const collectInputs = <Output, Input, Error, Env>(
|
|
|
2010
1987
|
* })
|
|
2011
1988
|
* ```
|
|
2012
1989
|
*
|
|
2013
|
-
* @
|
|
2014
|
-
* @
|
|
1990
|
+
* @category utils
|
|
1991
|
+
* @since 4.0.0
|
|
2015
1992
|
*/
|
|
2016
1993
|
export const collectOutputs = <Output, Input, Error, Env>(
|
|
2017
1994
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -2021,31 +1998,11 @@ export const collectOutputs = <Output, Input, Error, Env>(
|
|
|
2021
1998
|
* Returns a new `Schedule` that recurs as long as the specified `predicate`
|
|
2022
1999
|
* returns `true`, collecting all outputs of the schedule into an array.
|
|
2023
2000
|
*
|
|
2024
|
-
*
|
|
2001
|
+
* **Example** (Collecting outputs while a condition holds)
|
|
2002
|
+
*
|
|
2025
2003
|
* ```ts
|
|
2026
2004
|
* import { Console, Effect, Schedule } from "effect"
|
|
2027
2005
|
*
|
|
2028
|
-
* // Collect outputs while under time limit
|
|
2029
|
-
* const collectForTime = Schedule.collectWhile(
|
|
2030
|
-
* Schedule.spaced("500 millis"),
|
|
2031
|
-
* (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
|
|
2032
|
-
* )
|
|
2033
|
-
*
|
|
2034
|
-
* const timeBasedProgram = Effect.gen(function*() {
|
|
2035
|
-
* const results = yield* Effect.repeat(
|
|
2036
|
-
* Effect.gen(function*() {
|
|
2037
|
-
* const value = Math.floor(Math.random() * 100)
|
|
2038
|
-
* yield* Console.log(`Generated value: ${value}`)
|
|
2039
|
-
* return value
|
|
2040
|
-
* }),
|
|
2041
|
-
* collectForTime
|
|
2042
|
-
* )
|
|
2043
|
-
*
|
|
2044
|
-
* yield* Console.log(
|
|
2045
|
-
* `Collected ${results.length} values: [${results.join(", ")}]`
|
|
2046
|
-
* )
|
|
2047
|
-
* })
|
|
2048
|
-
*
|
|
2049
2006
|
* // Collect outputs while condition is met
|
|
2050
2007
|
* const collectWhileSmall = Schedule.collectWhile(
|
|
2051
2008
|
* Schedule.exponential("100 millis"),
|
|
@@ -2056,16 +2013,16 @@ export const collectOutputs = <Output, Input, Error, Env>(
|
|
|
2056
2013
|
* const conditionalProgram = Effect.gen(function*() {
|
|
2057
2014
|
* let attempt = 0
|
|
2058
2015
|
*
|
|
2059
|
-
* const
|
|
2016
|
+
* const attempts = yield* Effect.repeat(
|
|
2060
2017
|
* Effect.gen(function*() {
|
|
2061
2018
|
* attempt++
|
|
2062
2019
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2063
|
-
* return
|
|
2020
|
+
* return `attempt-${attempt}`
|
|
2064
2021
|
* }),
|
|
2065
2022
|
* collectWhileSmall
|
|
2066
2023
|
* )
|
|
2067
2024
|
*
|
|
2068
|
-
* yield* Console.log(`Collected attempts: [${
|
|
2025
|
+
* yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
|
|
2069
2026
|
* })
|
|
2070
2027
|
*
|
|
2071
2028
|
* // Collect with effectful predicate
|
|
@@ -2082,19 +2039,17 @@ export const collectOutputs = <Output, Input, Error, Env>(
|
|
|
2082
2039
|
* )
|
|
2083
2040
|
*
|
|
2084
2041
|
* const effectfulProgram = Effect.gen(function*() {
|
|
2085
|
-
* const
|
|
2086
|
-
* Effect.
|
|
2087
|
-
* const now = new Date().toISOString()
|
|
2088
|
-
* yield* Console.log(`Task at ${now}`)
|
|
2089
|
-
* return now
|
|
2090
|
-
* }),
|
|
2042
|
+
* const results = yield* Effect.repeat(
|
|
2043
|
+
* Effect.succeed("checked"),
|
|
2091
2044
|
* collectWithCheck
|
|
2092
2045
|
* )
|
|
2093
2046
|
*
|
|
2094
|
-
* yield* Console.log(`Final collection: ${
|
|
2047
|
+
* yield* Console.log(`Final collection: ${results.length} items`)
|
|
2095
2048
|
* })
|
|
2096
2049
|
*
|
|
2097
2050
|
* // Collect samples with condition
|
|
2051
|
+
* const samples = [12, 18, 24, 30, 36]
|
|
2052
|
+
*
|
|
2098
2053
|
* const collectSamples = Schedule.collectWhile(
|
|
2099
2054
|
* Schedule.spaced("200 millis"),
|
|
2100
2055
|
* (metadata) =>
|
|
@@ -2102,55 +2057,36 @@ export const collectOutputs = <Output, Input, Error, Env>(
|
|
|
2102
2057
|
* )
|
|
2103
2058
|
*
|
|
2104
2059
|
* const samplingProgram = Effect.gen(function*() {
|
|
2105
|
-
*
|
|
2060
|
+
* let index = 0
|
|
2061
|
+
* const collected = yield* Effect.repeat(
|
|
2106
2062
|
* Effect.gen(function*() {
|
|
2107
|
-
* const sample =
|
|
2108
|
-
* yield* Console.log(`Sample: ${sample
|
|
2063
|
+
* const sample = samples[index++]
|
|
2064
|
+
* yield* Console.log(`Sample: ${sample}`)
|
|
2109
2065
|
* return sample
|
|
2110
2066
|
* }),
|
|
2111
2067
|
* collectSamples
|
|
2112
2068
|
* )
|
|
2113
2069
|
*
|
|
2114
|
-
* const average =
|
|
2070
|
+
* const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
|
|
2115
2071
|
* yield* Console.log(
|
|
2116
|
-
* `Collected ${
|
|
2072
|
+
* `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
|
|
2117
2073
|
* )
|
|
2118
2074
|
* })
|
|
2119
2075
|
* ```
|
|
2120
2076
|
*
|
|
2077
|
+
* @category utils
|
|
2121
2078
|
* @since 2.0.0
|
|
2122
|
-
* @category utilities
|
|
2123
2079
|
*/
|
|
2124
2080
|
export const collectWhile: {
|
|
2125
2081
|
/**
|
|
2126
2082
|
* Returns a new `Schedule` that recurs as long as the specified `predicate`
|
|
2127
2083
|
* returns `true`, collecting all outputs of the schedule into an array.
|
|
2128
2084
|
*
|
|
2129
|
-
*
|
|
2085
|
+
* **Example** (Collecting outputs while a condition holds)
|
|
2086
|
+
*
|
|
2130
2087
|
* ```ts
|
|
2131
2088
|
* import { Console, Effect, Schedule } from "effect"
|
|
2132
2089
|
*
|
|
2133
|
-
* // Collect outputs while under time limit
|
|
2134
|
-
* const collectForTime = Schedule.collectWhile(
|
|
2135
|
-
* Schedule.spaced("500 millis"),
|
|
2136
|
-
* (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
|
|
2137
|
-
* )
|
|
2138
|
-
*
|
|
2139
|
-
* const timeBasedProgram = Effect.gen(function*() {
|
|
2140
|
-
* const results = yield* Effect.repeat(
|
|
2141
|
-
* Effect.gen(function*() {
|
|
2142
|
-
* const value = Math.floor(Math.random() * 100)
|
|
2143
|
-
* yield* Console.log(`Generated value: ${value}`)
|
|
2144
|
-
* return value
|
|
2145
|
-
* }),
|
|
2146
|
-
* collectForTime
|
|
2147
|
-
* )
|
|
2148
|
-
*
|
|
2149
|
-
* yield* Console.log(
|
|
2150
|
-
* `Collected ${results.length} values: [${results.join(", ")}]`
|
|
2151
|
-
* )
|
|
2152
|
-
* })
|
|
2153
|
-
*
|
|
2154
2090
|
* // Collect outputs while condition is met
|
|
2155
2091
|
* const collectWhileSmall = Schedule.collectWhile(
|
|
2156
2092
|
* Schedule.exponential("100 millis"),
|
|
@@ -2161,16 +2097,16 @@ export const collectWhile: {
|
|
|
2161
2097
|
* const conditionalProgram = Effect.gen(function*() {
|
|
2162
2098
|
* let attempt = 0
|
|
2163
2099
|
*
|
|
2164
|
-
* const
|
|
2100
|
+
* const attempts = yield* Effect.repeat(
|
|
2165
2101
|
* Effect.gen(function*() {
|
|
2166
2102
|
* attempt++
|
|
2167
2103
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2168
|
-
* return
|
|
2104
|
+
* return `attempt-${attempt}`
|
|
2169
2105
|
* }),
|
|
2170
2106
|
* collectWhileSmall
|
|
2171
2107
|
* )
|
|
2172
2108
|
*
|
|
2173
|
-
* yield* Console.log(`Collected attempts: [${
|
|
2109
|
+
* yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
|
|
2174
2110
|
* })
|
|
2175
2111
|
*
|
|
2176
2112
|
* // Collect with effectful predicate
|
|
@@ -2187,19 +2123,17 @@ export const collectWhile: {
|
|
|
2187
2123
|
* )
|
|
2188
2124
|
*
|
|
2189
2125
|
* const effectfulProgram = Effect.gen(function*() {
|
|
2190
|
-
* const
|
|
2191
|
-
* Effect.
|
|
2192
|
-
* const now = new Date().toISOString()
|
|
2193
|
-
* yield* Console.log(`Task at ${now}`)
|
|
2194
|
-
* return now
|
|
2195
|
-
* }),
|
|
2126
|
+
* const results = yield* Effect.repeat(
|
|
2127
|
+
* Effect.succeed("checked"),
|
|
2196
2128
|
* collectWithCheck
|
|
2197
2129
|
* )
|
|
2198
2130
|
*
|
|
2199
|
-
* yield* Console.log(`Final collection: ${
|
|
2131
|
+
* yield* Console.log(`Final collection: ${results.length} items`)
|
|
2200
2132
|
* })
|
|
2201
2133
|
*
|
|
2202
2134
|
* // Collect samples with condition
|
|
2135
|
+
* const samples = [12, 18, 24, 30, 36]
|
|
2136
|
+
*
|
|
2203
2137
|
* const collectSamples = Schedule.collectWhile(
|
|
2204
2138
|
* Schedule.spaced("200 millis"),
|
|
2205
2139
|
* (metadata) =>
|
|
@@ -2207,24 +2141,25 @@ export const collectWhile: {
|
|
|
2207
2141
|
* )
|
|
2208
2142
|
*
|
|
2209
2143
|
* const samplingProgram = Effect.gen(function*() {
|
|
2210
|
-
*
|
|
2144
|
+
* let index = 0
|
|
2145
|
+
* const collected = yield* Effect.repeat(
|
|
2211
2146
|
* Effect.gen(function*() {
|
|
2212
|
-
* const sample =
|
|
2213
|
-
* yield* Console.log(`Sample: ${sample
|
|
2147
|
+
* const sample = samples[index++]
|
|
2148
|
+
* yield* Console.log(`Sample: ${sample}`)
|
|
2214
2149
|
* return sample
|
|
2215
2150
|
* }),
|
|
2216
2151
|
* collectSamples
|
|
2217
2152
|
* )
|
|
2218
2153
|
*
|
|
2219
|
-
* const average =
|
|
2154
|
+
* const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
|
|
2220
2155
|
* yield* Console.log(
|
|
2221
|
-
* `Collected ${
|
|
2156
|
+
* `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
|
|
2222
2157
|
* )
|
|
2223
2158
|
* })
|
|
2224
2159
|
* ```
|
|
2225
2160
|
*
|
|
2161
|
+
* @category utils
|
|
2226
2162
|
* @since 2.0.0
|
|
2227
|
-
* @category utilities
|
|
2228
2163
|
*/
|
|
2229
2164
|
<Input, Output, Error2 = never, Env2 = never>(
|
|
2230
2165
|
predicate: (
|
|
@@ -2237,31 +2172,11 @@ export const collectWhile: {
|
|
|
2237
2172
|
* Returns a new `Schedule` that recurs as long as the specified `predicate`
|
|
2238
2173
|
* returns `true`, collecting all outputs of the schedule into an array.
|
|
2239
2174
|
*
|
|
2240
|
-
*
|
|
2175
|
+
* **Example** (Collecting outputs while a condition holds)
|
|
2176
|
+
*
|
|
2241
2177
|
* ```ts
|
|
2242
2178
|
* import { Console, Effect, Schedule } from "effect"
|
|
2243
2179
|
*
|
|
2244
|
-
* // Collect outputs while under time limit
|
|
2245
|
-
* const collectForTime = Schedule.collectWhile(
|
|
2246
|
-
* Schedule.spaced("500 millis"),
|
|
2247
|
-
* (metadata) => Effect.succeed(metadata.elapsed < 3000) // Stop after 3 seconds
|
|
2248
|
-
* )
|
|
2249
|
-
*
|
|
2250
|
-
* const timeBasedProgram = Effect.gen(function*() {
|
|
2251
|
-
* const results = yield* Effect.repeat(
|
|
2252
|
-
* Effect.gen(function*() {
|
|
2253
|
-
* const value = Math.floor(Math.random() * 100)
|
|
2254
|
-
* yield* Console.log(`Generated value: ${value}`)
|
|
2255
|
-
* return value
|
|
2256
|
-
* }),
|
|
2257
|
-
* collectForTime
|
|
2258
|
-
* )
|
|
2259
|
-
*
|
|
2260
|
-
* yield* Console.log(
|
|
2261
|
-
* `Collected ${results.length} values: [${results.join(", ")}]`
|
|
2262
|
-
* )
|
|
2263
|
-
* })
|
|
2264
|
-
*
|
|
2265
2180
|
* // Collect outputs while condition is met
|
|
2266
2181
|
* const collectWhileSmall = Schedule.collectWhile(
|
|
2267
2182
|
* Schedule.exponential("100 millis"),
|
|
@@ -2272,16 +2187,16 @@ export const collectWhile: {
|
|
|
2272
2187
|
* const conditionalProgram = Effect.gen(function*() {
|
|
2273
2188
|
* let attempt = 0
|
|
2274
2189
|
*
|
|
2275
|
-
* const
|
|
2190
|
+
* const attempts = yield* Effect.repeat(
|
|
2276
2191
|
* Effect.gen(function*() {
|
|
2277
2192
|
* attempt++
|
|
2278
2193
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2279
|
-
* return
|
|
2194
|
+
* return `attempt-${attempt}`
|
|
2280
2195
|
* }),
|
|
2281
2196
|
* collectWhileSmall
|
|
2282
2197
|
* )
|
|
2283
2198
|
*
|
|
2284
|
-
* yield* Console.log(`Collected attempts: [${
|
|
2199
|
+
* yield* Console.log(`Collected attempts: [${attempts.join(", ")}]`)
|
|
2285
2200
|
* })
|
|
2286
2201
|
*
|
|
2287
2202
|
* // Collect with effectful predicate
|
|
@@ -2298,19 +2213,17 @@ export const collectWhile: {
|
|
|
2298
2213
|
* )
|
|
2299
2214
|
*
|
|
2300
2215
|
* const effectfulProgram = Effect.gen(function*() {
|
|
2301
|
-
* const
|
|
2302
|
-
* Effect.
|
|
2303
|
-
* const now = new Date().toISOString()
|
|
2304
|
-
* yield* Console.log(`Task at ${now}`)
|
|
2305
|
-
* return now
|
|
2306
|
-
* }),
|
|
2216
|
+
* const results = yield* Effect.repeat(
|
|
2217
|
+
* Effect.succeed("checked"),
|
|
2307
2218
|
* collectWithCheck
|
|
2308
2219
|
* )
|
|
2309
2220
|
*
|
|
2310
|
-
* yield* Console.log(`Final collection: ${
|
|
2221
|
+
* yield* Console.log(`Final collection: ${results.length} items`)
|
|
2311
2222
|
* })
|
|
2312
2223
|
*
|
|
2313
2224
|
* // Collect samples with condition
|
|
2225
|
+
* const samples = [12, 18, 24, 30, 36]
|
|
2226
|
+
*
|
|
2314
2227
|
* const collectSamples = Schedule.collectWhile(
|
|
2315
2228
|
* Schedule.spaced("200 millis"),
|
|
2316
2229
|
* (metadata) =>
|
|
@@ -2318,24 +2231,25 @@ export const collectWhile: {
|
|
|
2318
2231
|
* )
|
|
2319
2232
|
*
|
|
2320
2233
|
* const samplingProgram = Effect.gen(function*() {
|
|
2321
|
-
*
|
|
2234
|
+
* let index = 0
|
|
2235
|
+
* const collected = yield* Effect.repeat(
|
|
2322
2236
|
* Effect.gen(function*() {
|
|
2323
|
-
* const sample =
|
|
2324
|
-
* yield* Console.log(`Sample: ${sample
|
|
2237
|
+
* const sample = samples[index++]
|
|
2238
|
+
* yield* Console.log(`Sample: ${sample}`)
|
|
2325
2239
|
* return sample
|
|
2326
2240
|
* }),
|
|
2327
2241
|
* collectSamples
|
|
2328
2242
|
* )
|
|
2329
2243
|
*
|
|
2330
|
-
* const average =
|
|
2244
|
+
* const average = collected.reduce((sum, s) => sum + s, 0) / collected.length
|
|
2331
2245
|
* yield* Console.log(
|
|
2332
|
-
* `Collected ${
|
|
2246
|
+
* `Collected ${collected.length} samples, average: ${average.toFixed(1)}`
|
|
2333
2247
|
* )
|
|
2334
2248
|
* })
|
|
2335
2249
|
* ```
|
|
2336
2250
|
*
|
|
2251
|
+
* @category utils
|
|
2337
2252
|
* @since 2.0.0
|
|
2338
|
-
* @category utilities
|
|
2339
2253
|
*/
|
|
2340
2254
|
<Output, Input, Error, Env, Error2 = never, Env2 = never>(
|
|
2341
2255
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -2358,7 +2272,8 @@ export const collectWhile: {
|
|
|
2358
2272
|
* Returns a new `Schedule` that recurs on the specified `Cron` schedule and
|
|
2359
2273
|
* outputs the duration between recurrences.
|
|
2360
2274
|
*
|
|
2361
|
-
*
|
|
2275
|
+
* **Example** (Scheduling work with cron expressions)
|
|
2276
|
+
*
|
|
2362
2277
|
* ```ts
|
|
2363
2278
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2364
2279
|
*
|
|
@@ -2370,7 +2285,7 @@ export const collectWhile: {
|
|
|
2370
2285
|
* const minutelyProgram = Effect.gen(function*() {
|
|
2371
2286
|
* yield* Effect.repeat(
|
|
2372
2287
|
* Effect.gen(function*() {
|
|
2373
|
-
* yield* Console.log(
|
|
2288
|
+
* yield* Console.log("Running minutely task")
|
|
2374
2289
|
* return "minute"
|
|
2375
2290
|
* }),
|
|
2376
2291
|
* everyMinute.pipe(
|
|
@@ -2408,8 +2323,8 @@ export const collectWhile: {
|
|
|
2408
2323
|
* Effect.gen(function*() {
|
|
2409
2324
|
* yield* Console.log("Generating weekly report...")
|
|
2410
2325
|
* const report = {
|
|
2411
|
-
* week:
|
|
2412
|
-
*
|
|
2326
|
+
* week: 42,
|
|
2327
|
+
* status: "ready" as const
|
|
2413
2328
|
* }
|
|
2414
2329
|
* yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
|
|
2415
2330
|
* return report
|
|
@@ -2422,10 +2337,13 @@ export const collectWhile: {
|
|
|
2422
2337
|
* const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
|
|
2423
2338
|
*
|
|
2424
2339
|
* const businessProgram = Effect.gen(function*() {
|
|
2340
|
+
* const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
|
|
2341
|
+
* let index = 0
|
|
2342
|
+
*
|
|
2425
2343
|
* yield* Effect.repeat(
|
|
2426
2344
|
* Effect.gen(function*() {
|
|
2427
2345
|
* yield* Console.log("Business hours health check...")
|
|
2428
|
-
* const status =
|
|
2346
|
+
* const status = statuses[index++]
|
|
2429
2347
|
* yield* Console.log(`System status: ${status}`)
|
|
2430
2348
|
* return status
|
|
2431
2349
|
* }),
|
|
@@ -2442,9 +2360,9 @@ export const collectWhile: {
|
|
|
2442
2360
|
* yield* Effect.repeat(
|
|
2443
2361
|
* Effect.gen(function*() {
|
|
2444
2362
|
* yield* Console.log("Processing monthly invoices...")
|
|
2445
|
-
* const invoiceCount =
|
|
2363
|
+
* const invoiceCount = 72
|
|
2446
2364
|
* yield* Console.log(`Processed ${invoiceCount} invoices`)
|
|
2447
|
-
* return { count: invoiceCount,
|
|
2365
|
+
* return { count: invoiceCount, batch: "2024-01-a" }
|
|
2448
2366
|
* }),
|
|
2449
2367
|
* monthlyInvoice.pipe(Schedule.take(1))
|
|
2450
2368
|
* )
|
|
@@ -2458,11 +2376,13 @@ export const collectWhile: {
|
|
|
2458
2376
|
* )
|
|
2459
2377
|
*
|
|
2460
2378
|
* const robustProgram = Effect.gen(function*() {
|
|
2379
|
+
* let attempt = 0
|
|
2380
|
+
*
|
|
2461
2381
|
* yield* Effect.repeat(
|
|
2462
2382
|
* Effect.gen(function*() {
|
|
2383
|
+
* attempt++
|
|
2463
2384
|
* yield* Console.log("Complex scheduled task...")
|
|
2464
|
-
*
|
|
2465
|
-
* if (Math.random() < 0.3) {
|
|
2385
|
+
* if (attempt === 1) {
|
|
2466
2386
|
* return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
|
|
2467
2387
|
* }
|
|
2468
2388
|
* return "success"
|
|
@@ -2476,15 +2396,16 @@ export const collectWhile: {
|
|
|
2476
2396
|
* })
|
|
2477
2397
|
* ```
|
|
2478
2398
|
*
|
|
2479
|
-
* @since 4.0.0
|
|
2480
2399
|
* @category constructors
|
|
2400
|
+
* @since 2.0.0
|
|
2481
2401
|
*/
|
|
2482
2402
|
export const cron: {
|
|
2483
2403
|
/**
|
|
2484
2404
|
* Returns a new `Schedule` that recurs on the specified `Cron` schedule and
|
|
2485
2405
|
* outputs the duration between recurrences.
|
|
2486
2406
|
*
|
|
2487
|
-
*
|
|
2407
|
+
* **Example** (Scheduling work with cron expressions)
|
|
2408
|
+
*
|
|
2488
2409
|
* ```ts
|
|
2489
2410
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2490
2411
|
*
|
|
@@ -2496,7 +2417,7 @@ export const cron: {
|
|
|
2496
2417
|
* const minutelyProgram = Effect.gen(function*() {
|
|
2497
2418
|
* yield* Effect.repeat(
|
|
2498
2419
|
* Effect.gen(function*() {
|
|
2499
|
-
* yield* Console.log(
|
|
2420
|
+
* yield* Console.log("Running minutely task")
|
|
2500
2421
|
* return "minute"
|
|
2501
2422
|
* }),
|
|
2502
2423
|
* everyMinute.pipe(
|
|
@@ -2534,8 +2455,8 @@ export const cron: {
|
|
|
2534
2455
|
* Effect.gen(function*() {
|
|
2535
2456
|
* yield* Console.log("Generating weekly report...")
|
|
2536
2457
|
* const report = {
|
|
2537
|
-
* week:
|
|
2538
|
-
*
|
|
2458
|
+
* week: 42,
|
|
2459
|
+
* status: "ready" as const
|
|
2539
2460
|
* }
|
|
2540
2461
|
* yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
|
|
2541
2462
|
* return report
|
|
@@ -2548,10 +2469,13 @@ export const cron: {
|
|
|
2548
2469
|
* const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
|
|
2549
2470
|
*
|
|
2550
2471
|
* const businessProgram = Effect.gen(function*() {
|
|
2472
|
+
* const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
|
|
2473
|
+
* let index = 0
|
|
2474
|
+
*
|
|
2551
2475
|
* yield* Effect.repeat(
|
|
2552
2476
|
* Effect.gen(function*() {
|
|
2553
2477
|
* yield* Console.log("Business hours health check...")
|
|
2554
|
-
* const status =
|
|
2478
|
+
* const status = statuses[index++]
|
|
2555
2479
|
* yield* Console.log(`System status: ${status}`)
|
|
2556
2480
|
* return status
|
|
2557
2481
|
* }),
|
|
@@ -2568,9 +2492,9 @@ export const cron: {
|
|
|
2568
2492
|
* yield* Effect.repeat(
|
|
2569
2493
|
* Effect.gen(function*() {
|
|
2570
2494
|
* yield* Console.log("Processing monthly invoices...")
|
|
2571
|
-
* const invoiceCount =
|
|
2495
|
+
* const invoiceCount = 72
|
|
2572
2496
|
* yield* Console.log(`Processed ${invoiceCount} invoices`)
|
|
2573
|
-
* return { count: invoiceCount,
|
|
2497
|
+
* return { count: invoiceCount, batch: "2024-01-a" }
|
|
2574
2498
|
* }),
|
|
2575
2499
|
* monthlyInvoice.pipe(Schedule.take(1))
|
|
2576
2500
|
* )
|
|
@@ -2584,11 +2508,13 @@ export const cron: {
|
|
|
2584
2508
|
* )
|
|
2585
2509
|
*
|
|
2586
2510
|
* const robustProgram = Effect.gen(function*() {
|
|
2511
|
+
* let attempt = 0
|
|
2512
|
+
*
|
|
2587
2513
|
* yield* Effect.repeat(
|
|
2588
2514
|
* Effect.gen(function*() {
|
|
2515
|
+
* attempt++
|
|
2589
2516
|
* yield* Console.log("Complex scheduled task...")
|
|
2590
|
-
*
|
|
2591
|
-
* if (Math.random() < 0.3) {
|
|
2517
|
+
* if (attempt === 1) {
|
|
2592
2518
|
* return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
|
|
2593
2519
|
* }
|
|
2594
2520
|
* return "success"
|
|
@@ -2602,15 +2528,16 @@ export const cron: {
|
|
|
2602
2528
|
* })
|
|
2603
2529
|
* ```
|
|
2604
2530
|
*
|
|
2605
|
-
* @since 4.0.0
|
|
2606
2531
|
* @category constructors
|
|
2532
|
+
* @since 2.0.0
|
|
2607
2533
|
*/
|
|
2608
2534
|
(expression: Cron.Cron): Schedule<Duration.Duration, unknown, Cron.CronParseError>
|
|
2609
2535
|
/**
|
|
2610
2536
|
* Returns a new `Schedule` that recurs on the specified `Cron` schedule and
|
|
2611
2537
|
* outputs the duration between recurrences.
|
|
2612
2538
|
*
|
|
2613
|
-
*
|
|
2539
|
+
* **Example** (Scheduling work with cron expressions)
|
|
2540
|
+
*
|
|
2614
2541
|
* ```ts
|
|
2615
2542
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2616
2543
|
*
|
|
@@ -2622,7 +2549,7 @@ export const cron: {
|
|
|
2622
2549
|
* const minutelyProgram = Effect.gen(function*() {
|
|
2623
2550
|
* yield* Effect.repeat(
|
|
2624
2551
|
* Effect.gen(function*() {
|
|
2625
|
-
* yield* Console.log(
|
|
2552
|
+
* yield* Console.log("Running minutely task")
|
|
2626
2553
|
* return "minute"
|
|
2627
2554
|
* }),
|
|
2628
2555
|
* everyMinute.pipe(
|
|
@@ -2660,8 +2587,8 @@ export const cron: {
|
|
|
2660
2587
|
* Effect.gen(function*() {
|
|
2661
2588
|
* yield* Console.log("Generating weekly report...")
|
|
2662
2589
|
* const report = {
|
|
2663
|
-
* week:
|
|
2664
|
-
*
|
|
2590
|
+
* week: 42,
|
|
2591
|
+
* status: "ready" as const
|
|
2665
2592
|
* }
|
|
2666
2593
|
* yield* Console.log(`Report generated: ${JSON.stringify(report)}`)
|
|
2667
2594
|
* return report
|
|
@@ -2674,10 +2601,13 @@ export const cron: {
|
|
|
2674
2601
|
* const businessHoursCheck = Schedule.cron("0,15,30,45 9-17 * * 1-5")
|
|
2675
2602
|
*
|
|
2676
2603
|
* const businessProgram = Effect.gen(function*() {
|
|
2604
|
+
* const statuses = ["healthy", "healthy", "degraded", "healthy"] as const
|
|
2605
|
+
* let index = 0
|
|
2606
|
+
*
|
|
2677
2607
|
* yield* Effect.repeat(
|
|
2678
2608
|
* Effect.gen(function*() {
|
|
2679
2609
|
* yield* Console.log("Business hours health check...")
|
|
2680
|
-
* const status =
|
|
2610
|
+
* const status = statuses[index++]
|
|
2681
2611
|
* yield* Console.log(`System status: ${status}`)
|
|
2682
2612
|
* return status
|
|
2683
2613
|
* }),
|
|
@@ -2694,9 +2624,9 @@ export const cron: {
|
|
|
2694
2624
|
* yield* Effect.repeat(
|
|
2695
2625
|
* Effect.gen(function*() {
|
|
2696
2626
|
* yield* Console.log("Processing monthly invoices...")
|
|
2697
|
-
* const invoiceCount =
|
|
2627
|
+
* const invoiceCount = 72
|
|
2698
2628
|
* yield* Console.log(`Processed ${invoiceCount} invoices`)
|
|
2699
|
-
* return { count: invoiceCount,
|
|
2629
|
+
* return { count: invoiceCount, batch: "2024-01-a" }
|
|
2700
2630
|
* }),
|
|
2701
2631
|
* monthlyInvoice.pipe(Schedule.take(1))
|
|
2702
2632
|
* )
|
|
@@ -2710,11 +2640,13 @@ export const cron: {
|
|
|
2710
2640
|
* )
|
|
2711
2641
|
*
|
|
2712
2642
|
* const robustProgram = Effect.gen(function*() {
|
|
2643
|
+
* let attempt = 0
|
|
2644
|
+
*
|
|
2713
2645
|
* yield* Effect.repeat(
|
|
2714
2646
|
* Effect.gen(function*() {
|
|
2647
|
+
* attempt++
|
|
2715
2648
|
* yield* Console.log("Complex scheduled task...")
|
|
2716
|
-
*
|
|
2717
|
-
* if (Math.random() < 0.3) {
|
|
2649
|
+
* if (attempt === 1) {
|
|
2718
2650
|
* return yield* Effect.fail(new ScheduledTaskError({ message: "Scheduled task failed" }))
|
|
2719
2651
|
* }
|
|
2720
2652
|
* return "success"
|
|
@@ -2728,8 +2660,8 @@ export const cron: {
|
|
|
2728
2660
|
* })
|
|
2729
2661
|
* ```
|
|
2730
2662
|
*
|
|
2731
|
-
* @since 4.0.0
|
|
2732
2663
|
* @category constructors
|
|
2664
|
+
* @since 2.0.0
|
|
2733
2665
|
*/
|
|
2734
2666
|
(expression: string, tz?: string | DateTime.TimeZone): Schedule<Duration.Duration, unknown, Cron.CronParseError>
|
|
2735
2667
|
} = (expression: string | Cron.Cron, tz?: string | DateTime.TimeZone) => {
|
|
@@ -2745,7 +2677,8 @@ export const cron: {
|
|
|
2745
2677
|
/**
|
|
2746
2678
|
* Returns a new schedule that outputs the delay between each occurence.
|
|
2747
2679
|
*
|
|
2748
|
-
*
|
|
2680
|
+
* **Example** (Extracting schedule delays)
|
|
2681
|
+
*
|
|
2749
2682
|
* ```ts
|
|
2750
2683
|
* import { Console, Effect, Schedule } from "effect"
|
|
2751
2684
|
*
|
|
@@ -2805,7 +2738,7 @@ export const cron: {
|
|
|
2805
2738
|
* yield* Effect.repeat(
|
|
2806
2739
|
* Effect.gen(function*() {
|
|
2807
2740
|
* yield* Console.log("Adaptive task execution")
|
|
2808
|
-
* return
|
|
2741
|
+
* return "completed"
|
|
2809
2742
|
* }),
|
|
2810
2743
|
* adaptiveDelays.pipe(
|
|
2811
2744
|
* Schedule.tapOutput((delay) => Console.log(`Adaptive delay: ${delay}`))
|
|
@@ -2822,8 +2755,8 @@ export const cron: {
|
|
|
2822
2755
|
* )
|
|
2823
2756
|
* ```
|
|
2824
2757
|
*
|
|
2825
|
-
* @since 2.0.0
|
|
2826
2758
|
* @category constructors
|
|
2759
|
+
* @since 2.0.0
|
|
2827
2760
|
*/
|
|
2828
2761
|
export const delays = <Out, In, E, R>(self: Schedule<Out, In, E, R>): Schedule<Duration.Duration, In, E, R> =>
|
|
2829
2762
|
fromStep(
|
|
@@ -2843,8 +2776,8 @@ export const delays = <Out, In, E, R>(self: Schedule<Out, In, E, R>): Schedule<D
|
|
|
2843
2776
|
* The schedule outputs the configured duration for its first recurrence and
|
|
2844
2777
|
* then completes.
|
|
2845
2778
|
*
|
|
2846
|
-
* @since 2.0.0
|
|
2847
2779
|
* @category constructors
|
|
2780
|
+
* @since 2.0.0
|
|
2848
2781
|
*/
|
|
2849
2782
|
export const duration = (durationInput: Duration.Input): Schedule<Duration.Duration> => {
|
|
2850
2783
|
const duration = Duration.fromInputUnsafe(durationInput)
|
|
@@ -2859,7 +2792,8 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
|
|
|
2859
2792
|
* Returns a new `Schedule` that will always recur, but only during the
|
|
2860
2793
|
* specified `duration` of time.
|
|
2861
2794
|
*
|
|
2862
|
-
*
|
|
2795
|
+
* **Example** (Repeating work during a duration)
|
|
2796
|
+
*
|
|
2863
2797
|
* ```ts
|
|
2864
2798
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2865
2799
|
*
|
|
@@ -2869,12 +2803,9 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
|
|
|
2869
2803
|
* const fiveSecondSchedule = Schedule.during("5 seconds")
|
|
2870
2804
|
*
|
|
2871
2805
|
* const timedProgram = Effect.gen(function*() {
|
|
2872
|
-
* const startTime = Date.now()
|
|
2873
|
-
*
|
|
2874
2806
|
* yield* Effect.repeat(
|
|
2875
2807
|
* Effect.gen(function*() {
|
|
2876
|
-
*
|
|
2877
|
-
* yield* Console.log(`Task executed after ${elapsed}ms`)
|
|
2808
|
+
* yield* Console.log("Task executed inside the time window")
|
|
2878
2809
|
* yield* Effect.sleep("500 millis") // Each task takes 500ms
|
|
2879
2810
|
* return "task done"
|
|
2880
2811
|
* }),
|
|
@@ -2902,8 +2833,8 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
|
|
|
2902
2833
|
*
|
|
2903
2834
|
* yield* Effect.repeat(
|
|
2904
2835
|
* Effect.gen(function*() {
|
|
2905
|
-
* yield* Console.log(
|
|
2906
|
-
* return
|
|
2836
|
+
* yield* Console.log("Burst task")
|
|
2837
|
+
* return "burst"
|
|
2907
2838
|
* }),
|
|
2908
2839
|
* burstWindow
|
|
2909
2840
|
* )
|
|
@@ -2924,7 +2855,7 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
|
|
|
2924
2855
|
* attempt++
|
|
2925
2856
|
* yield* Console.log(`Retry attempt ${attempt}`)
|
|
2926
2857
|
*
|
|
2927
|
-
* if (
|
|
2858
|
+
* if (attempt < 4) {
|
|
2928
2859
|
* return yield* Effect.fail(new RetryAttemptError({ message: `Attempt ${attempt} failed` }))
|
|
2929
2860
|
* }
|
|
2930
2861
|
*
|
|
@@ -2939,8 +2870,8 @@ export const duration = (durationInput: Duration.Input): Schedule<Duration.Durat
|
|
|
2939
2870
|
* )
|
|
2940
2871
|
* ```
|
|
2941
2872
|
*
|
|
2942
|
-
* @since 4.0.0
|
|
2943
2873
|
* @category constructors
|
|
2874
|
+
* @since 4.0.0
|
|
2944
2875
|
*/
|
|
2945
2876
|
export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
|
|
2946
2877
|
while_(
|
|
@@ -2953,7 +2884,8 @@ export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
|
|
|
2953
2884
|
* to recur, using the minimum of the two durations between recurrences and
|
|
2954
2885
|
* outputting a tuple of the outputs of both schedules.
|
|
2955
2886
|
*
|
|
2956
|
-
*
|
|
2887
|
+
* **Example** (Combining schedules with either semantics)
|
|
2888
|
+
*
|
|
2957
2889
|
* ```ts
|
|
2958
2890
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
2959
2891
|
*
|
|
@@ -2970,7 +2902,7 @@ export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
|
|
|
2970
2902
|
* const program = Effect.gen(function*() {
|
|
2971
2903
|
* const results = yield* Effect.repeat(
|
|
2972
2904
|
* Effect.gen(function*() {
|
|
2973
|
-
* yield* Console.log(
|
|
2905
|
+
* yield* Console.log("Task executed")
|
|
2974
2906
|
* return "task completed"
|
|
2975
2907
|
* }),
|
|
2976
2908
|
* eitherSchedule.pipe(
|
|
@@ -3016,8 +2948,8 @@ export const during = (duration: Duration.Input): Schedule<Duration.Duration> =>
|
|
|
3016
2948
|
* // Compare with intersect which provides intersection semantics (AND logic)
|
|
3017
2949
|
* ```
|
|
3018
2950
|
*
|
|
2951
|
+
* @category utils
|
|
3019
2952
|
* @since 2.0.0
|
|
3020
|
-
* @category utilities
|
|
3021
2953
|
*/
|
|
3022
2954
|
export const either: {
|
|
3023
2955
|
/**
|
|
@@ -3025,7 +2957,8 @@ export const either: {
|
|
|
3025
2957
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3026
2958
|
* outputting a tuple of the outputs of both schedules.
|
|
3027
2959
|
*
|
|
3028
|
-
*
|
|
2960
|
+
* **Example** (Combining schedules with either semantics)
|
|
2961
|
+
*
|
|
3029
2962
|
* ```ts
|
|
3030
2963
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
3031
2964
|
*
|
|
@@ -3042,7 +2975,7 @@ export const either: {
|
|
|
3042
2975
|
* const program = Effect.gen(function*() {
|
|
3043
2976
|
* const results = yield* Effect.repeat(
|
|
3044
2977
|
* Effect.gen(function*() {
|
|
3045
|
-
* yield* Console.log(
|
|
2978
|
+
* yield* Console.log("Task executed")
|
|
3046
2979
|
* return "task completed"
|
|
3047
2980
|
* }),
|
|
3048
2981
|
* eitherSchedule.pipe(
|
|
@@ -3088,8 +3021,8 @@ export const either: {
|
|
|
3088
3021
|
* // Compare with intersect which provides intersection semantics (AND logic)
|
|
3089
3022
|
* ```
|
|
3090
3023
|
*
|
|
3024
|
+
* @category utils
|
|
3091
3025
|
* @since 2.0.0
|
|
3092
|
-
* @category utilities
|
|
3093
3026
|
*/
|
|
3094
3027
|
<Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
|
|
3095
3028
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -3099,7 +3032,8 @@ export const either: {
|
|
|
3099
3032
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3100
3033
|
* outputting a tuple of the outputs of both schedules.
|
|
3101
3034
|
*
|
|
3102
|
-
*
|
|
3035
|
+
* **Example** (Combining schedules with either semantics)
|
|
3036
|
+
*
|
|
3103
3037
|
* ```ts
|
|
3104
3038
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
3105
3039
|
*
|
|
@@ -3116,7 +3050,7 @@ export const either: {
|
|
|
3116
3050
|
* const program = Effect.gen(function*() {
|
|
3117
3051
|
* const results = yield* Effect.repeat(
|
|
3118
3052
|
* Effect.gen(function*() {
|
|
3119
|
-
* yield* Console.log(
|
|
3053
|
+
* yield* Console.log("Task executed")
|
|
3120
3054
|
* return "task completed"
|
|
3121
3055
|
* }),
|
|
3122
3056
|
* eitherSchedule.pipe(
|
|
@@ -3162,8 +3096,8 @@ export const either: {
|
|
|
3162
3096
|
* // Compare with intersect which provides intersection semantics (AND logic)
|
|
3163
3097
|
* ```
|
|
3164
3098
|
*
|
|
3099
|
+
* @category utils
|
|
3165
3100
|
* @since 2.0.0
|
|
3166
|
-
* @category utilities
|
|
3167
3101
|
*/
|
|
3168
3102
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
3169
3103
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -3180,7 +3114,8 @@ export const either: {
|
|
|
3180
3114
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3181
3115
|
* outputting the result of the left schedule (i.e. `self`).
|
|
3182
3116
|
*
|
|
3183
|
-
*
|
|
3117
|
+
* **Example** (Combining either schedules and keeping the left output)
|
|
3118
|
+
*
|
|
3184
3119
|
* ```ts
|
|
3185
3120
|
* import { Console, Effect, Schedule } from "effect"
|
|
3186
3121
|
*
|
|
@@ -3206,8 +3141,8 @@ export const either: {
|
|
|
3206
3141
|
* })
|
|
3207
3142
|
* ```
|
|
3208
3143
|
*
|
|
3209
|
-
* @
|
|
3210
|
-
* @
|
|
3144
|
+
* @category utils
|
|
3145
|
+
* @since 4.0.0
|
|
3211
3146
|
*/
|
|
3212
3147
|
export const eitherLeft: {
|
|
3213
3148
|
/**
|
|
@@ -3215,7 +3150,8 @@ export const eitherLeft: {
|
|
|
3215
3150
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3216
3151
|
* outputting the result of the left schedule (i.e. `self`).
|
|
3217
3152
|
*
|
|
3218
|
-
*
|
|
3153
|
+
* **Example** (Combining either schedules and keeping the left output)
|
|
3154
|
+
*
|
|
3219
3155
|
* ```ts
|
|
3220
3156
|
* import { Console, Effect, Schedule } from "effect"
|
|
3221
3157
|
*
|
|
@@ -3241,8 +3177,8 @@ export const eitherLeft: {
|
|
|
3241
3177
|
* })
|
|
3242
3178
|
* ```
|
|
3243
3179
|
*
|
|
3244
|
-
* @
|
|
3245
|
-
* @
|
|
3180
|
+
* @category utils
|
|
3181
|
+
* @since 4.0.0
|
|
3246
3182
|
*/
|
|
3247
3183
|
<Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
|
|
3248
3184
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -3252,7 +3188,8 @@ export const eitherLeft: {
|
|
|
3252
3188
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3253
3189
|
* outputting the result of the left schedule (i.e. `self`).
|
|
3254
3190
|
*
|
|
3255
|
-
*
|
|
3191
|
+
* **Example** (Combining either schedules and keeping the left output)
|
|
3192
|
+
*
|
|
3256
3193
|
* ```ts
|
|
3257
3194
|
* import { Console, Effect, Schedule } from "effect"
|
|
3258
3195
|
*
|
|
@@ -3278,8 +3215,8 @@ export const eitherLeft: {
|
|
|
3278
3215
|
* })
|
|
3279
3216
|
* ```
|
|
3280
3217
|
*
|
|
3281
|
-
* @
|
|
3282
|
-
* @
|
|
3218
|
+
* @category utils
|
|
3219
|
+
* @since 4.0.0
|
|
3283
3220
|
*/
|
|
3284
3221
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
3285
3222
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -3295,7 +3232,8 @@ export const eitherLeft: {
|
|
|
3295
3232
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3296
3233
|
* outputting the result of the right schedule (i.e. `other`).
|
|
3297
3234
|
*
|
|
3298
|
-
*
|
|
3235
|
+
* **Example** (Combining either schedules and keeping the right output)
|
|
3236
|
+
*
|
|
3299
3237
|
* ```ts
|
|
3300
3238
|
* import { Console, Effect, Schedule } from "effect"
|
|
3301
3239
|
*
|
|
@@ -3321,8 +3259,8 @@ export const eitherLeft: {
|
|
|
3321
3259
|
* })
|
|
3322
3260
|
* ```
|
|
3323
3261
|
*
|
|
3324
|
-
* @
|
|
3325
|
-
* @
|
|
3262
|
+
* @category utils
|
|
3263
|
+
* @since 4.0.0
|
|
3326
3264
|
*/
|
|
3327
3265
|
export const eitherRight: {
|
|
3328
3266
|
/**
|
|
@@ -3330,7 +3268,8 @@ export const eitherRight: {
|
|
|
3330
3268
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3331
3269
|
* outputting the result of the right schedule (i.e. `other`).
|
|
3332
3270
|
*
|
|
3333
|
-
*
|
|
3271
|
+
* **Example** (Combining either schedules and keeping the right output)
|
|
3272
|
+
*
|
|
3334
3273
|
* ```ts
|
|
3335
3274
|
* import { Console, Effect, Schedule } from "effect"
|
|
3336
3275
|
*
|
|
@@ -3356,8 +3295,8 @@ export const eitherRight: {
|
|
|
3356
3295
|
* })
|
|
3357
3296
|
* ```
|
|
3358
3297
|
*
|
|
3359
|
-
* @
|
|
3360
|
-
* @
|
|
3298
|
+
* @category utils
|
|
3299
|
+
* @since 4.0.0
|
|
3361
3300
|
*/
|
|
3362
3301
|
<Output2, Input2, Error2, Env2>(other: Schedule<Output2, Input2, Error2, Env2>): <Output, Input, Error, Env>(
|
|
3363
3302
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -3367,7 +3306,8 @@ export const eitherRight: {
|
|
|
3367
3306
|
* to recur, using the minimum of the two durations between recurrences and
|
|
3368
3307
|
* outputting the result of the right schedule (i.e. `other`).
|
|
3369
3308
|
*
|
|
3370
|
-
*
|
|
3309
|
+
* **Example** (Combining either schedules and keeping the right output)
|
|
3310
|
+
*
|
|
3371
3311
|
* ```ts
|
|
3372
3312
|
* import { Console, Effect, Schedule } from "effect"
|
|
3373
3313
|
*
|
|
@@ -3393,8 +3333,8 @@ export const eitherRight: {
|
|
|
3393
3333
|
* })
|
|
3394
3334
|
* ```
|
|
3395
3335
|
*
|
|
3396
|
-
* @
|
|
3397
|
-
* @
|
|
3336
|
+
* @category utils
|
|
3337
|
+
* @since 4.0.0
|
|
3398
3338
|
*/
|
|
3399
3339
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2>(
|
|
3400
3340
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -3411,7 +3351,8 @@ export const eitherRight: {
|
|
|
3411
3351
|
* outputting the result of the combination of both schedule outputs using the
|
|
3412
3352
|
* specified `combine` function.
|
|
3413
3353
|
*
|
|
3414
|
-
*
|
|
3354
|
+
* **Example** (Combining either schedule outputs)
|
|
3355
|
+
*
|
|
3415
3356
|
* ```ts
|
|
3416
3357
|
* import { Console, Effect, Schedule } from "effect"
|
|
3417
3358
|
*
|
|
@@ -3441,8 +3382,8 @@ export const eitherRight: {
|
|
|
3441
3382
|
* })
|
|
3442
3383
|
* ```
|
|
3443
3384
|
*
|
|
3385
|
+
* @category utils
|
|
3444
3386
|
* @since 2.0.0
|
|
3445
|
-
* @category utilities
|
|
3446
3387
|
*/
|
|
3447
3388
|
export const eitherWith: {
|
|
3448
3389
|
/**
|
|
@@ -3451,7 +3392,8 @@ export const eitherWith: {
|
|
|
3451
3392
|
* outputting the result of the combination of both schedule outputs using the
|
|
3452
3393
|
* specified `combine` function.
|
|
3453
3394
|
*
|
|
3454
|
-
*
|
|
3395
|
+
* **Example** (Combining either schedule outputs)
|
|
3396
|
+
*
|
|
3455
3397
|
* ```ts
|
|
3456
3398
|
* import { Console, Effect, Schedule } from "effect"
|
|
3457
3399
|
*
|
|
@@ -3481,8 +3423,8 @@ export const eitherWith: {
|
|
|
3481
3423
|
* })
|
|
3482
3424
|
* ```
|
|
3483
3425
|
*
|
|
3426
|
+
* @category utils
|
|
3484
3427
|
* @since 2.0.0
|
|
3485
|
-
* @category utilities
|
|
3486
3428
|
*/
|
|
3487
3429
|
<Output2, Input2, Error2, Env2, Output, Output3>(
|
|
3488
3430
|
other: Schedule<Output2, Input2, Error2, Env2>,
|
|
@@ -3496,7 +3438,8 @@ export const eitherWith: {
|
|
|
3496
3438
|
* outputting the result of the combination of both schedule outputs using the
|
|
3497
3439
|
* specified `combine` function.
|
|
3498
3440
|
*
|
|
3499
|
-
*
|
|
3441
|
+
* **Example** (Combining either schedule outputs)
|
|
3442
|
+
*
|
|
3500
3443
|
* ```ts
|
|
3501
3444
|
* import { Console, Effect, Schedule } from "effect"
|
|
3502
3445
|
*
|
|
@@ -3526,8 +3469,8 @@ export const eitherWith: {
|
|
|
3526
3469
|
* })
|
|
3527
3470
|
* ```
|
|
3528
3471
|
*
|
|
3472
|
+
* @category utils
|
|
3529
3473
|
* @since 2.0.0
|
|
3530
|
-
* @category utilities
|
|
3531
3474
|
*/
|
|
3532
3475
|
<Output, Input, Error, Env, Output2, Input2, Error2, Env2, Output3>(
|
|
3533
3476
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -3558,7 +3501,8 @@ export const eitherWith: {
|
|
|
3558
3501
|
* outputting the result of the combination of both schedule outputs using the
|
|
3559
3502
|
* specified `combine` function.
|
|
3560
3503
|
*
|
|
3561
|
-
*
|
|
3504
|
+
* **Example** (Combining either schedule outputs)
|
|
3505
|
+
*
|
|
3562
3506
|
* ```ts
|
|
3563
3507
|
* import { Console, Effect, Schedule } from "effect"
|
|
3564
3508
|
*
|
|
@@ -3588,8 +3532,8 @@ export const eitherWith: {
|
|
|
3588
3532
|
* })
|
|
3589
3533
|
* ```
|
|
3590
3534
|
*
|
|
3535
|
+
* @category utils
|
|
3591
3536
|
* @since 2.0.0
|
|
3592
|
-
* @category utilities
|
|
3593
3537
|
*/
|
|
3594
3538
|
[Output3, Duration.Duration]>([
|
|
3595
3539
|
combine(leftResult[0], rightDone as Output2),
|
|
@@ -3617,9 +3561,8 @@ export const eitherWith: {
|
|
|
3617
3561
|
* This schedule never stops and outputs the cumulative time that has passed since the schedule
|
|
3618
3562
|
* started executing. Useful for tracking execution time or implementing time-based logic.
|
|
3619
3563
|
*
|
|
3620
|
-
*
|
|
3564
|
+
* **Example** (Measuring elapsed schedule time)
|
|
3621
3565
|
*
|
|
3622
|
-
* @example
|
|
3623
3566
|
* ```ts
|
|
3624
3567
|
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
3625
3568
|
*
|
|
@@ -3637,8 +3580,8 @@ export const eitherWith: {
|
|
|
3637
3580
|
* })
|
|
3638
3581
|
* ```
|
|
3639
3582
|
*
|
|
3640
|
-
* @since 2.0.0
|
|
3641
3583
|
* @category constructors
|
|
3584
|
+
* @since 2.0.0
|
|
3642
3585
|
*/
|
|
3643
3586
|
export const elapsed: Schedule<Duration.Duration> = fromStepWithMetadata(
|
|
3644
3587
|
effect.succeed((meta) => effect.succeed([Duration.millis(meta.elapsed), Duration.zero] as const))
|
|
@@ -3649,7 +3592,8 @@ export const elapsed: Schedule<Duration.Duration> = fromStepWithMetadata(
|
|
|
3649
3592
|
* repetitions, given by `base * factor.pow(n)`, where `n` is the number of
|
|
3650
3593
|
* repetitions so far. Returns the current duration between recurrences.
|
|
3651
3594
|
*
|
|
3652
|
-
*
|
|
3595
|
+
* **Example** (Retrying with exponential backoff)
|
|
3596
|
+
*
|
|
3653
3597
|
* ```ts
|
|
3654
3598
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
3655
3599
|
*
|
|
@@ -3689,8 +3633,8 @@ export const elapsed: Schedule<Duration.Duration> = fromStepWithMetadata(
|
|
|
3689
3633
|
* // Will retry with delays: 50ms, 100ms, 200ms before success
|
|
3690
3634
|
* ```
|
|
3691
3635
|
*
|
|
3692
|
-
* @since 2.0.0
|
|
3693
3636
|
* @category constructors
|
|
3637
|
+
* @since 2.0.0
|
|
3694
3638
|
*/
|
|
3695
3639
|
export const exponential = (
|
|
3696
3640
|
base: Duration.Input,
|
|
@@ -3708,7 +3652,8 @@ export const exponential = (
|
|
|
3708
3652
|
* two delays (similar to the fibonacci sequence). Returns the current
|
|
3709
3653
|
* duration between recurrences.
|
|
3710
3654
|
*
|
|
3711
|
-
*
|
|
3655
|
+
* **Example** (Retrying with fibonacci backoff)
|
|
3656
|
+
*
|
|
3712
3657
|
* ```ts
|
|
3713
3658
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
3714
3659
|
*
|
|
@@ -3744,7 +3689,7 @@ export const exponential = (
|
|
|
3744
3689
|
*
|
|
3745
3690
|
* // Heartbeat with fibonacci intervals (starts fast, gets slower)
|
|
3746
3691
|
* const adaptiveHeartbeat = Effect.gen(function*() {
|
|
3747
|
-
* yield* Console.log(
|
|
3692
|
+
* yield* Console.log("Heartbeat")
|
|
3748
3693
|
* return "pulse"
|
|
3749
3694
|
* }).pipe(
|
|
3750
3695
|
* Effect.repeat(
|
|
@@ -3766,8 +3711,8 @@ export const exponential = (
|
|
|
3766
3711
|
* })
|
|
3767
3712
|
* ```
|
|
3768
3713
|
*
|
|
3769
|
-
* @since 2.0.0
|
|
3770
3714
|
* @category constructors
|
|
3715
|
+
* @since 2.0.0
|
|
3771
3716
|
*/
|
|
3772
3717
|
export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
|
|
3773
3718
|
const oneMillis = Duration.toMillis(Duration.fromInputUnsafe(one))
|
|
@@ -3796,7 +3741,8 @@ export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
|
|
|
3796
3741
|
* |---------action--------||action|-----|action|-----------|
|
|
3797
3742
|
* ```
|
|
3798
3743
|
*
|
|
3799
|
-
*
|
|
3744
|
+
* **Example** (Repeating on fixed intervals)
|
|
3745
|
+
*
|
|
3800
3746
|
* ```ts
|
|
3801
3747
|
* import { Console, Effect, Schedule } from "effect"
|
|
3802
3748
|
*
|
|
@@ -3805,7 +3751,7 @@ export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
|
|
|
3805
3751
|
*
|
|
3806
3752
|
* // Health check that runs at fixed intervals
|
|
3807
3753
|
* const healthCheck = Effect.gen(function*() {
|
|
3808
|
-
* yield* Console.log(
|
|
3754
|
+
* yield* Console.log("Health check")
|
|
3809
3755
|
* yield* Effect.sleep("200 millis") // simulate health check work
|
|
3810
3756
|
* return "healthy"
|
|
3811
3757
|
* }).pipe(
|
|
@@ -3843,8 +3789,8 @@ export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => {
|
|
|
3843
3789
|
* })
|
|
3844
3790
|
* ```
|
|
3845
3791
|
*
|
|
3846
|
-
* @since 2.0.0
|
|
3847
3792
|
* @category constructors
|
|
3793
|
+
* @since 2.0.0
|
|
3848
3794
|
*/
|
|
3849
3795
|
export const fixed = (interval: Duration.Input): Schedule<number> => {
|
|
3850
3796
|
const window = Duration.toMillis(Duration.fromInputUnsafe(interval))
|
|
@@ -3874,7 +3820,8 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
|
|
|
3874
3820
|
* Returns a new `Schedule` that maps the output of this schedule using the
|
|
3875
3821
|
* specified function.
|
|
3876
3822
|
*
|
|
3877
|
-
*
|
|
3823
|
+
* **Example** (Mapping schedule outputs)
|
|
3824
|
+
*
|
|
3878
3825
|
* ```ts
|
|
3879
3826
|
* import { Console, Effect, Schedule } from "effect"
|
|
3880
3827
|
*
|
|
@@ -3892,7 +3839,6 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
|
|
|
3892
3839
|
* const structuredSchedule = Schedule.spaced("1 second").pipe(
|
|
3893
3840
|
* Schedule.map((recurrence) => Effect.succeed({
|
|
3894
3841
|
* iteration: recurrence + 1,
|
|
3895
|
-
* timestamp: new Date().toISOString(),
|
|
3896
3842
|
* phase: recurrence < 5 ? "warmup" as const : "steady" as const
|
|
3897
3843
|
* }))
|
|
3898
3844
|
* )
|
|
@@ -3904,7 +3850,7 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
|
|
|
3904
3850
|
* Schedule.take(8),
|
|
3905
3851
|
* Schedule.tapOutput((info) =>
|
|
3906
3852
|
* Console.log(
|
|
3907
|
-
* `${info.phase} phase - iteration ${info.iteration}
|
|
3853
|
+
* `${info.phase} phase - iteration ${info.iteration}`
|
|
3908
3854
|
* )
|
|
3909
3855
|
* )
|
|
3910
3856
|
* )
|
|
@@ -3929,15 +3875,16 @@ export const fixed = (interval: Duration.Input): Schedule<number> => {
|
|
|
3929
3875
|
* )
|
|
3930
3876
|
* ```
|
|
3931
3877
|
*
|
|
3932
|
-
* @since 2.0.0
|
|
3933
3878
|
* @category mapping
|
|
3879
|
+
* @since 2.0.0
|
|
3934
3880
|
*/
|
|
3935
3881
|
export const map: {
|
|
3936
3882
|
/**
|
|
3937
3883
|
* Returns a new `Schedule` that maps the output of this schedule using the
|
|
3938
3884
|
* specified function.
|
|
3939
3885
|
*
|
|
3940
|
-
*
|
|
3886
|
+
* **Example** (Mapping schedule outputs)
|
|
3887
|
+
*
|
|
3941
3888
|
* ```ts
|
|
3942
3889
|
* import { Console, Effect, Schedule } from "effect"
|
|
3943
3890
|
*
|
|
@@ -3955,7 +3902,6 @@ export const map: {
|
|
|
3955
3902
|
* const structuredSchedule = Schedule.spaced("1 second").pipe(
|
|
3956
3903
|
* Schedule.map((recurrence) => Effect.succeed({
|
|
3957
3904
|
* iteration: recurrence + 1,
|
|
3958
|
-
* timestamp: new Date().toISOString(),
|
|
3959
3905
|
* phase: recurrence < 5 ? "warmup" as const : "steady" as const
|
|
3960
3906
|
* }))
|
|
3961
3907
|
* )
|
|
@@ -3967,7 +3913,7 @@ export const map: {
|
|
|
3967
3913
|
* Schedule.take(8),
|
|
3968
3914
|
* Schedule.tapOutput((info) =>
|
|
3969
3915
|
* Console.log(
|
|
3970
|
-
* `${info.phase} phase - iteration ${info.iteration}
|
|
3916
|
+
* `${info.phase} phase - iteration ${info.iteration}`
|
|
3971
3917
|
* )
|
|
3972
3918
|
* )
|
|
3973
3919
|
* )
|
|
@@ -3992,8 +3938,8 @@ export const map: {
|
|
|
3992
3938
|
* )
|
|
3993
3939
|
* ```
|
|
3994
3940
|
*
|
|
3995
|
-
* @since 2.0.0
|
|
3996
3941
|
* @category mapping
|
|
3942
|
+
* @since 2.0.0
|
|
3997
3943
|
*/
|
|
3998
3944
|
<Output, Output2, Error2 = never, Env2 = never>(f: (output: Output) => Output2 | Effect<Output2, Error2, Env2>): <Input, Error, Env>(
|
|
3999
3945
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -4002,7 +3948,8 @@ export const map: {
|
|
|
4002
3948
|
* Returns a new `Schedule` that maps the output of this schedule using the
|
|
4003
3949
|
* specified function.
|
|
4004
3950
|
*
|
|
4005
|
-
*
|
|
3951
|
+
* **Example** (Mapping schedule outputs)
|
|
3952
|
+
*
|
|
4006
3953
|
* ```ts
|
|
4007
3954
|
* import { Console, Effect, Schedule } from "effect"
|
|
4008
3955
|
*
|
|
@@ -4020,7 +3967,6 @@ export const map: {
|
|
|
4020
3967
|
* const structuredSchedule = Schedule.spaced("1 second").pipe(
|
|
4021
3968
|
* Schedule.map((recurrence) => Effect.succeed({
|
|
4022
3969
|
* iteration: recurrence + 1,
|
|
4023
|
-
* timestamp: new Date().toISOString(),
|
|
4024
3970
|
* phase: recurrence < 5 ? "warmup" as const : "steady" as const
|
|
4025
3971
|
* }))
|
|
4026
3972
|
* )
|
|
@@ -4032,7 +3978,7 @@ export const map: {
|
|
|
4032
3978
|
* Schedule.take(8),
|
|
4033
3979
|
* Schedule.tapOutput((info) =>
|
|
4034
3980
|
* Console.log(
|
|
4035
|
-
* `${info.phase} phase - iteration ${info.iteration}
|
|
3981
|
+
* `${info.phase} phase - iteration ${info.iteration}`
|
|
4036
3982
|
* )
|
|
4037
3983
|
* )
|
|
4038
3984
|
* )
|
|
@@ -4057,8 +4003,8 @@ export const map: {
|
|
|
4057
4003
|
* )
|
|
4058
4004
|
* ```
|
|
4059
4005
|
*
|
|
4060
|
-
* @since 2.0.0
|
|
4061
4006
|
* @category mapping
|
|
4007
|
+
* @since 2.0.0
|
|
4062
4008
|
*/
|
|
4063
4009
|
<Output, Input, Error, Env, Output2, Error2 = never, Env2 = never>(
|
|
4064
4010
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -4088,7 +4034,8 @@ export const map: {
|
|
|
4088
4034
|
* Returns a new `Schedule` that modifies the delay of the next recurrence
|
|
4089
4035
|
* of the schedule using the specified effectual function.
|
|
4090
4036
|
*
|
|
4091
|
-
*
|
|
4037
|
+
* **Example** (Modifying delays from schedule output)
|
|
4038
|
+
*
|
|
4092
4039
|
* ```ts
|
|
4093
4040
|
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
4094
4041
|
*
|
|
@@ -4113,15 +4060,16 @@ export const map: {
|
|
|
4113
4060
|
* })
|
|
4114
4061
|
* ```
|
|
4115
4062
|
*
|
|
4063
|
+
* @category utils
|
|
4116
4064
|
* @since 2.0.0
|
|
4117
|
-
* @category utilities
|
|
4118
4065
|
*/
|
|
4119
4066
|
export const modifyDelay: {
|
|
4120
4067
|
/**
|
|
4121
4068
|
* Returns a new `Schedule` that modifies the delay of the next recurrence
|
|
4122
4069
|
* of the schedule using the specified effectual function.
|
|
4123
4070
|
*
|
|
4124
|
-
*
|
|
4071
|
+
* **Example** (Modifying delays from schedule output)
|
|
4072
|
+
*
|
|
4125
4073
|
* ```ts
|
|
4126
4074
|
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
4127
4075
|
*
|
|
@@ -4146,8 +4094,8 @@ export const modifyDelay: {
|
|
|
4146
4094
|
* })
|
|
4147
4095
|
* ```
|
|
4148
4096
|
*
|
|
4097
|
+
* @category utils
|
|
4149
4098
|
* @since 2.0.0
|
|
4150
|
-
* @category utilities
|
|
4151
4099
|
*/
|
|
4152
4100
|
<Output, Error2 = never, Env2 = never>(
|
|
4153
4101
|
f: (
|
|
@@ -4161,7 +4109,8 @@ export const modifyDelay: {
|
|
|
4161
4109
|
* Returns a new `Schedule` that modifies the delay of the next recurrence
|
|
4162
4110
|
* of the schedule using the specified effectual function.
|
|
4163
4111
|
*
|
|
4164
|
-
*
|
|
4112
|
+
* **Example** (Modifying delays from schedule output)
|
|
4113
|
+
*
|
|
4165
4114
|
* ```ts
|
|
4166
4115
|
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
4167
4116
|
*
|
|
@@ -4186,8 +4135,8 @@ export const modifyDelay: {
|
|
|
4186
4135
|
* })
|
|
4187
4136
|
* ```
|
|
4188
4137
|
*
|
|
4138
|
+
* @category utils
|
|
4189
4139
|
* @since 2.0.0
|
|
4190
|
-
* @category utilities
|
|
4191
4140
|
*/
|
|
4192
4141
|
<Output, Input, Error, Env, Error2 = never, Env2 = never>(
|
|
4193
4142
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -4214,8 +4163,8 @@ export const modifyDelay: {
|
|
|
4214
4163
|
*
|
|
4215
4164
|
* Delays are jittered between `80%` and `120%` of the original delay.
|
|
4216
4165
|
*
|
|
4166
|
+
* @category utils
|
|
4217
4167
|
* @since 2.0.0
|
|
4218
|
-
* @category utilities
|
|
4219
4168
|
*/
|
|
4220
4169
|
export const jittered = <Output, Input, Error, Env>(
|
|
4221
4170
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -4229,7 +4178,8 @@ export const jittered = <Output, Input, Error, Env>(
|
|
|
4229
4178
|
/**
|
|
4230
4179
|
* Returns a new `Schedule` that outputs the inputs of the specified schedule.
|
|
4231
4180
|
*
|
|
4232
|
-
*
|
|
4181
|
+
* **Example** (Passing inputs through as outputs)
|
|
4182
|
+
*
|
|
4233
4183
|
* ```ts
|
|
4234
4184
|
* import { Console, Effect, Schedule } from "effect"
|
|
4235
4185
|
*
|
|
@@ -4251,8 +4201,8 @@ export const jittered = <Output, Input, Error, Env>(
|
|
|
4251
4201
|
* })
|
|
4252
4202
|
* ```
|
|
4253
4203
|
*
|
|
4204
|
+
* @category utils
|
|
4254
4205
|
* @since 2.0.0
|
|
4255
|
-
* @category utilities
|
|
4256
4206
|
*/
|
|
4257
4207
|
export const passthrough = <Output, Input, Error, Env>(
|
|
4258
4208
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -4268,7 +4218,8 @@ export const passthrough = <Output, Input, Error, Env>(
|
|
|
4268
4218
|
* Returns a `Schedule` which can only be stepped the specified number of
|
|
4269
4219
|
* `times` before it terminates.
|
|
4270
4220
|
*
|
|
4271
|
-
*
|
|
4221
|
+
* **Example** (Limiting recurrences)
|
|
4222
|
+
*
|
|
4272
4223
|
* ```ts
|
|
4273
4224
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4274
4225
|
*
|
|
@@ -4306,7 +4257,7 @@ export const passthrough = <Output, Input, Error, Env>(
|
|
|
4306
4257
|
* // Repeat an effect exactly 10 times
|
|
4307
4258
|
* const exactlyTenTimes = Effect.gen(function*() {
|
|
4308
4259
|
* yield* Console.log("Executing task...")
|
|
4309
|
-
* return
|
|
4260
|
+
* return "completed"
|
|
4310
4261
|
* }).pipe(
|
|
4311
4262
|
* Effect.repeat(Schedule.recurs(10))
|
|
4312
4263
|
* )
|
|
@@ -4328,7 +4279,8 @@ export const recurs = (times: number): Schedule<number> =>
|
|
|
4328
4279
|
* using the specified effectful `combine` function and starting from the
|
|
4329
4280
|
* specified `initial` state.
|
|
4330
4281
|
*
|
|
4331
|
-
*
|
|
4282
|
+
* **Example** (Reducing schedule outputs)
|
|
4283
|
+
*
|
|
4332
4284
|
* ```ts
|
|
4333
4285
|
* import { Console, Effect, Schedule } from "effect"
|
|
4334
4286
|
*
|
|
@@ -4353,24 +4305,24 @@ export const recurs = (times: number): Schedule<number> =>
|
|
|
4353
4305
|
* yield* Console.log(`Final sum: ${finalSum}`)
|
|
4354
4306
|
* })
|
|
4355
4307
|
*
|
|
4356
|
-
* // Build a history of execution
|
|
4308
|
+
* // Build a history of execution counts
|
|
4357
4309
|
* const historySchedule = Schedule.reduce(
|
|
4358
4310
|
* Schedule.spaced("1 second").pipe(Schedule.take(4)),
|
|
4359
4311
|
* () => [] as Array<number>, // Initial empty array
|
|
4360
|
-
* (history, executionNumber) => Effect.succeed([...history,
|
|
4312
|
+
* (history, executionNumber) => Effect.succeed([...history, executionNumber])
|
|
4361
4313
|
* )
|
|
4362
4314
|
*
|
|
4363
4315
|
* const historyProgram = Effect.gen(function*() {
|
|
4364
4316
|
* const timeline = yield* Effect.repeat(
|
|
4365
4317
|
* Effect.gen(function*() {
|
|
4366
|
-
* yield* Console.log("Recording
|
|
4318
|
+
* yield* Console.log("Recording execution...")
|
|
4367
4319
|
* return "recorded"
|
|
4368
4320
|
* }),
|
|
4369
4321
|
* historySchedule
|
|
4370
4322
|
* )
|
|
4371
4323
|
*
|
|
4372
4324
|
* yield* Console.log(
|
|
4373
|
-
* `Execution timeline: ${timeline.
|
|
4325
|
+
* `Execution timeline: ${timeline.join(", ")}`
|
|
4374
4326
|
* )
|
|
4375
4327
|
* })
|
|
4376
4328
|
*
|
|
@@ -4431,8 +4383,8 @@ export const recurs = (times: number): Schedule<number> =>
|
|
|
4431
4383
|
* })
|
|
4432
4384
|
* ```
|
|
4433
4385
|
*
|
|
4386
|
+
* @category utils
|
|
4434
4387
|
* @since 2.0.0
|
|
4435
|
-
* @category utilities
|
|
4436
4388
|
*/
|
|
4437
4389
|
export const reduce: {
|
|
4438
4390
|
/**
|
|
@@ -4440,7 +4392,8 @@ export const reduce: {
|
|
|
4440
4392
|
* using the specified effectful `combine` function and starting from the
|
|
4441
4393
|
* specified `initial` state.
|
|
4442
4394
|
*
|
|
4443
|
-
*
|
|
4395
|
+
* **Example** (Reducing schedule outputs)
|
|
4396
|
+
*
|
|
4444
4397
|
* ```ts
|
|
4445
4398
|
* import { Console, Effect, Schedule } from "effect"
|
|
4446
4399
|
*
|
|
@@ -4465,24 +4418,24 @@ export const reduce: {
|
|
|
4465
4418
|
* yield* Console.log(`Final sum: ${finalSum}`)
|
|
4466
4419
|
* })
|
|
4467
4420
|
*
|
|
4468
|
-
* // Build a history of execution
|
|
4421
|
+
* // Build a history of execution counts
|
|
4469
4422
|
* const historySchedule = Schedule.reduce(
|
|
4470
4423
|
* Schedule.spaced("1 second").pipe(Schedule.take(4)),
|
|
4471
4424
|
* () => [] as Array<number>, // Initial empty array
|
|
4472
|
-
* (history, executionNumber) => Effect.succeed([...history,
|
|
4425
|
+
* (history, executionNumber) => Effect.succeed([...history, executionNumber])
|
|
4473
4426
|
* )
|
|
4474
4427
|
*
|
|
4475
4428
|
* const historyProgram = Effect.gen(function*() {
|
|
4476
4429
|
* const timeline = yield* Effect.repeat(
|
|
4477
4430
|
* Effect.gen(function*() {
|
|
4478
|
-
* yield* Console.log("Recording
|
|
4431
|
+
* yield* Console.log("Recording execution...")
|
|
4479
4432
|
* return "recorded"
|
|
4480
4433
|
* }),
|
|
4481
4434
|
* historySchedule
|
|
4482
4435
|
* )
|
|
4483
4436
|
*
|
|
4484
4437
|
* yield* Console.log(
|
|
4485
|
-
* `Execution timeline: ${timeline.
|
|
4438
|
+
* `Execution timeline: ${timeline.join(", ")}`
|
|
4486
4439
|
* )
|
|
4487
4440
|
* })
|
|
4488
4441
|
*
|
|
@@ -4543,8 +4496,8 @@ export const reduce: {
|
|
|
4543
4496
|
* })
|
|
4544
4497
|
* ```
|
|
4545
4498
|
*
|
|
4499
|
+
* @category utils
|
|
4546
4500
|
* @since 2.0.0
|
|
4547
|
-
* @category utilities
|
|
4548
4501
|
*/
|
|
4549
4502
|
<State, Output, Error2 = never, Env2 = never>(
|
|
4550
4503
|
initial: LazyArg<State>,
|
|
@@ -4557,7 +4510,8 @@ export const reduce: {
|
|
|
4557
4510
|
* using the specified effectful `combine` function and starting from the
|
|
4558
4511
|
* specified `initial` state.
|
|
4559
4512
|
*
|
|
4560
|
-
*
|
|
4513
|
+
* **Example** (Reducing schedule outputs)
|
|
4514
|
+
*
|
|
4561
4515
|
* ```ts
|
|
4562
4516
|
* import { Console, Effect, Schedule } from "effect"
|
|
4563
4517
|
*
|
|
@@ -4582,24 +4536,24 @@ export const reduce: {
|
|
|
4582
4536
|
* yield* Console.log(`Final sum: ${finalSum}`)
|
|
4583
4537
|
* })
|
|
4584
4538
|
*
|
|
4585
|
-
* // Build a history of execution
|
|
4539
|
+
* // Build a history of execution counts
|
|
4586
4540
|
* const historySchedule = Schedule.reduce(
|
|
4587
4541
|
* Schedule.spaced("1 second").pipe(Schedule.take(4)),
|
|
4588
4542
|
* () => [] as Array<number>, // Initial empty array
|
|
4589
|
-
* (history, executionNumber) => Effect.succeed([...history,
|
|
4543
|
+
* (history, executionNumber) => Effect.succeed([...history, executionNumber])
|
|
4590
4544
|
* )
|
|
4591
4545
|
*
|
|
4592
4546
|
* const historyProgram = Effect.gen(function*() {
|
|
4593
4547
|
* const timeline = yield* Effect.repeat(
|
|
4594
4548
|
* Effect.gen(function*() {
|
|
4595
|
-
* yield* Console.log("Recording
|
|
4549
|
+
* yield* Console.log("Recording execution...")
|
|
4596
4550
|
* return "recorded"
|
|
4597
4551
|
* }),
|
|
4598
4552
|
* historySchedule
|
|
4599
4553
|
* )
|
|
4600
4554
|
*
|
|
4601
4555
|
* yield* Console.log(
|
|
4602
|
-
* `Execution timeline: ${timeline.
|
|
4556
|
+
* `Execution timeline: ${timeline.join(", ")}`
|
|
4603
4557
|
* )
|
|
4604
4558
|
* })
|
|
4605
4559
|
*
|
|
@@ -4660,8 +4614,8 @@ export const reduce: {
|
|
|
4660
4614
|
* })
|
|
4661
4615
|
* ```
|
|
4662
4616
|
*
|
|
4617
|
+
* @category utils
|
|
4663
4618
|
* @since 2.0.0
|
|
4664
|
-
* @category utilities
|
|
4665
4619
|
*/
|
|
4666
4620
|
<Output, Input, Error, Env, State, Error2 = never, Env2 = never>(
|
|
4667
4621
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -4700,7 +4654,8 @@ export const reduce: {
|
|
|
4700
4654
|
* Returns a schedule that recurs continuously, each repetition spaced the
|
|
4701
4655
|
* specified duration from the last run.
|
|
4702
4656
|
*
|
|
4703
|
-
*
|
|
4657
|
+
* **Example** (Repeating with fixed spacing)
|
|
4658
|
+
*
|
|
4704
4659
|
* ```ts
|
|
4705
4660
|
* import { Console, Effect, Schedule } from "effect"
|
|
4706
4661
|
*
|
|
@@ -4709,7 +4664,7 @@ export const reduce: {
|
|
|
4709
4664
|
*
|
|
4710
4665
|
* // Heartbeat that runs indefinitely with fixed spacing
|
|
4711
4666
|
* const heartbeat = Effect.gen(function*() {
|
|
4712
|
-
* yield* Console.log(
|
|
4667
|
+
* yield* Console.log("Heartbeat")
|
|
4713
4668
|
* }).pipe(
|
|
4714
4669
|
* Effect.repeat(everyTwoSeconds)
|
|
4715
4670
|
* )
|
|
@@ -4742,8 +4697,8 @@ export const reduce: {
|
|
|
4742
4697
|
* })
|
|
4743
4698
|
* ```
|
|
4744
4699
|
*
|
|
4745
|
-
* @since 2.0.0
|
|
4746
4700
|
* @category constructors
|
|
4701
|
+
* @since 2.0.0
|
|
4747
4702
|
*/
|
|
4748
4703
|
export const spaced = (duration: Duration.Input): Schedule<number> => {
|
|
4749
4704
|
const decoded = Duration.fromInputUnsafe(duration)
|
|
@@ -4755,7 +4710,8 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
|
|
|
4755
4710
|
* every input to the schedule, but does not alter the inputs and outputs of
|
|
4756
4711
|
* the schedule.
|
|
4757
4712
|
*
|
|
4758
|
-
*
|
|
4713
|
+
* **Example** (Tapping retry inputs)
|
|
4714
|
+
*
|
|
4759
4715
|
* ```ts
|
|
4760
4716
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4761
4717
|
*
|
|
@@ -4791,7 +4747,6 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
|
|
|
4791
4747
|
* Schedule.take(5),
|
|
4792
4748
|
* Schedule.tapInput((input: unknown) =>
|
|
4793
4749
|
* Effect.gen(function*() {
|
|
4794
|
-
* yield* Console.log(`Processing input at ${new Date().toISOString()}`)
|
|
4795
4750
|
* yield* Console.log(`Input type: ${typeof input}`)
|
|
4796
4751
|
* // In real applications, might send metrics to monitoring system
|
|
4797
4752
|
* })
|
|
@@ -4813,10 +4768,13 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
|
|
|
4813
4768
|
* )
|
|
4814
4769
|
*
|
|
4815
4770
|
* const validationProgram = Effect.gen(function*() {
|
|
4771
|
+
* let count = 0
|
|
4772
|
+
*
|
|
4816
4773
|
* yield* Effect.repeat(
|
|
4817
4774
|
* Effect.gen(function*() {
|
|
4775
|
+
* count++
|
|
4818
4776
|
* yield* Console.log("Task with validation")
|
|
4819
|
-
* return { data:
|
|
4777
|
+
* return { data: `sample-${count}` }
|
|
4820
4778
|
* }),
|
|
4821
4779
|
* validatingSchedule
|
|
4822
4780
|
* )
|
|
@@ -4828,10 +4786,10 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
|
|
|
4828
4786
|
* Schedule.tapInput((error: RetryError) =>
|
|
4829
4787
|
* Effect.gen(function*() {
|
|
4830
4788
|
* if (String(error).includes("critical")) {
|
|
4831
|
-
* yield* Console.log(
|
|
4789
|
+
* yield* Console.log(`Critical error: ${String(error)}`)
|
|
4832
4790
|
* // In real applications, might trigger alerts or notifications
|
|
4833
4791
|
* } else {
|
|
4834
|
-
* yield* Console.log(
|
|
4792
|
+
* yield* Console.log(`Regular error: ${String(error)}`)
|
|
4835
4793
|
* }
|
|
4836
4794
|
* })
|
|
4837
4795
|
* )
|
|
@@ -4865,14 +4823,14 @@ export const spaced = (duration: Duration.Input): Schedule<number> => {
|
|
|
4865
4823
|
* ),
|
|
4866
4824
|
* Schedule.tapInput((error: RetryError) =>
|
|
4867
4825
|
* String(error).length > 20
|
|
4868
|
-
* ? Console.log("
|
|
4826
|
+
* ? Console.log("Long error message detected")
|
|
4869
4827
|
* : Effect.void
|
|
4870
4828
|
* )
|
|
4871
4829
|
* )
|
|
4872
4830
|
* ```
|
|
4873
4831
|
*
|
|
4874
|
-
* @since 2.0.0
|
|
4875
4832
|
* @category sequencing
|
|
4833
|
+
* @since 2.0.0
|
|
4876
4834
|
*/
|
|
4877
4835
|
export const tapInput: {
|
|
4878
4836
|
/**
|
|
@@ -4880,7 +4838,8 @@ export const tapInput: {
|
|
|
4880
4838
|
* every input to the schedule, but does not alter the inputs and outputs of
|
|
4881
4839
|
* the schedule.
|
|
4882
4840
|
*
|
|
4883
|
-
*
|
|
4841
|
+
* **Example** (Tapping retry inputs)
|
|
4842
|
+
*
|
|
4884
4843
|
* ```ts
|
|
4885
4844
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
4886
4845
|
*
|
|
@@ -4916,7 +4875,6 @@ export const tapInput: {
|
|
|
4916
4875
|
* Schedule.take(5),
|
|
4917
4876
|
* Schedule.tapInput((input: unknown) =>
|
|
4918
4877
|
* Effect.gen(function*() {
|
|
4919
|
-
* yield* Console.log(`Processing input at ${new Date().toISOString()}`)
|
|
4920
4878
|
* yield* Console.log(`Input type: ${typeof input}`)
|
|
4921
4879
|
* // In real applications, might send metrics to monitoring system
|
|
4922
4880
|
* })
|
|
@@ -4938,10 +4896,13 @@ export const tapInput: {
|
|
|
4938
4896
|
* )
|
|
4939
4897
|
*
|
|
4940
4898
|
* const validationProgram = Effect.gen(function*() {
|
|
4899
|
+
* let count = 0
|
|
4900
|
+
*
|
|
4941
4901
|
* yield* Effect.repeat(
|
|
4942
4902
|
* Effect.gen(function*() {
|
|
4903
|
+
* count++
|
|
4943
4904
|
* yield* Console.log("Task with validation")
|
|
4944
|
-
* return { data:
|
|
4905
|
+
* return { data: `sample-${count}` }
|
|
4945
4906
|
* }),
|
|
4946
4907
|
* validatingSchedule
|
|
4947
4908
|
* )
|
|
@@ -4953,10 +4914,10 @@ export const tapInput: {
|
|
|
4953
4914
|
* Schedule.tapInput((error: RetryError) =>
|
|
4954
4915
|
* Effect.gen(function*() {
|
|
4955
4916
|
* if (String(error).includes("critical")) {
|
|
4956
|
-
* yield* Console.log(
|
|
4917
|
+
* yield* Console.log(`Critical error: ${String(error)}`)
|
|
4957
4918
|
* // In real applications, might trigger alerts or notifications
|
|
4958
4919
|
* } else {
|
|
4959
|
-
* yield* Console.log(
|
|
4920
|
+
* yield* Console.log(`Regular error: ${String(error)}`)
|
|
4960
4921
|
* }
|
|
4961
4922
|
* })
|
|
4962
4923
|
* )
|
|
@@ -4990,14 +4951,14 @@ export const tapInput: {
|
|
|
4990
4951
|
* ),
|
|
4991
4952
|
* Schedule.tapInput((error: RetryError) =>
|
|
4992
4953
|
* String(error).length > 20
|
|
4993
|
-
* ? Console.log("
|
|
4954
|
+
* ? Console.log("Long error message detected")
|
|
4994
4955
|
* : Effect.void
|
|
4995
4956
|
* )
|
|
4996
4957
|
* )
|
|
4997
4958
|
* ```
|
|
4998
4959
|
*
|
|
4999
|
-
* @since 2.0.0
|
|
5000
4960
|
* @category sequencing
|
|
4961
|
+
* @since 2.0.0
|
|
5001
4962
|
*/
|
|
5002
4963
|
<Input, X, Error2, Env2>(f: (input: Input) => Effect<X, Error2, Env2>): <Output, Error, Env>(
|
|
5003
4964
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -5007,7 +4968,8 @@ export const tapInput: {
|
|
|
5007
4968
|
* every input to the schedule, but does not alter the inputs and outputs of
|
|
5008
4969
|
* the schedule.
|
|
5009
4970
|
*
|
|
5010
|
-
*
|
|
4971
|
+
* **Example** (Tapping retry inputs)
|
|
4972
|
+
*
|
|
5011
4973
|
* ```ts
|
|
5012
4974
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
5013
4975
|
*
|
|
@@ -5043,7 +5005,6 @@ export const tapInput: {
|
|
|
5043
5005
|
* Schedule.take(5),
|
|
5044
5006
|
* Schedule.tapInput((input: unknown) =>
|
|
5045
5007
|
* Effect.gen(function*() {
|
|
5046
|
-
* yield* Console.log(`Processing input at ${new Date().toISOString()}`)
|
|
5047
5008
|
* yield* Console.log(`Input type: ${typeof input}`)
|
|
5048
5009
|
* // In real applications, might send metrics to monitoring system
|
|
5049
5010
|
* })
|
|
@@ -5065,10 +5026,13 @@ export const tapInput: {
|
|
|
5065
5026
|
* )
|
|
5066
5027
|
*
|
|
5067
5028
|
* const validationProgram = Effect.gen(function*() {
|
|
5029
|
+
* let count = 0
|
|
5030
|
+
*
|
|
5068
5031
|
* yield* Effect.repeat(
|
|
5069
5032
|
* Effect.gen(function*() {
|
|
5033
|
+
* count++
|
|
5070
5034
|
* yield* Console.log("Task with validation")
|
|
5071
|
-
* return { data:
|
|
5035
|
+
* return { data: `sample-${count}` }
|
|
5072
5036
|
* }),
|
|
5073
5037
|
* validatingSchedule
|
|
5074
5038
|
* )
|
|
@@ -5080,10 +5044,10 @@ export const tapInput: {
|
|
|
5080
5044
|
* Schedule.tapInput((error: RetryError) =>
|
|
5081
5045
|
* Effect.gen(function*() {
|
|
5082
5046
|
* if (String(error).includes("critical")) {
|
|
5083
|
-
* yield* Console.log(
|
|
5047
|
+
* yield* Console.log(`Critical error: ${String(error)}`)
|
|
5084
5048
|
* // In real applications, might trigger alerts or notifications
|
|
5085
5049
|
* } else {
|
|
5086
|
-
* yield* Console.log(
|
|
5050
|
+
* yield* Console.log(`Regular error: ${String(error)}`)
|
|
5087
5051
|
* }
|
|
5088
5052
|
* })
|
|
5089
5053
|
* )
|
|
@@ -5117,14 +5081,14 @@ export const tapInput: {
|
|
|
5117
5081
|
* ),
|
|
5118
5082
|
* Schedule.tapInput((error: RetryError) =>
|
|
5119
5083
|
* String(error).length > 20
|
|
5120
|
-
* ? Console.log("
|
|
5084
|
+
* ? Console.log("Long error message detected")
|
|
5121
5085
|
* : Effect.void
|
|
5122
5086
|
* )
|
|
5123
5087
|
* )
|
|
5124
5088
|
* ```
|
|
5125
5089
|
*
|
|
5126
|
-
* @since 2.0.0
|
|
5127
5090
|
* @category sequencing
|
|
5091
|
+
* @since 2.0.0
|
|
5128
5092
|
*/
|
|
5129
5093
|
<Output, Input, Error, Env, X, Error2, Env2>(
|
|
5130
5094
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -5144,7 +5108,8 @@ export const tapInput: {
|
|
|
5144
5108
|
* every output of the schedule, but does not alter the inputs and outputs of
|
|
5145
5109
|
* the schedule.
|
|
5146
5110
|
*
|
|
5147
|
-
*
|
|
5111
|
+
* **Example** (Tapping schedule outputs)
|
|
5112
|
+
*
|
|
5148
5113
|
* ```ts
|
|
5149
5114
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
5150
5115
|
*
|
|
@@ -5192,7 +5157,7 @@ export const tapInput: {
|
|
|
5192
5157
|
* Effect.gen(function*() {
|
|
5193
5158
|
* const delayMs = delay.toString()
|
|
5194
5159
|
* if (delayMs.includes("1000")) { // Alert on delays >= 1 second
|
|
5195
|
-
* yield* Console.log(
|
|
5160
|
+
* yield* Console.log(`High delay detected: ${delay}`)
|
|
5196
5161
|
* }
|
|
5197
5162
|
* })
|
|
5198
5163
|
* )
|
|
@@ -5202,8 +5167,7 @@ export const tapInput: {
|
|
|
5202
5167
|
* yield* Effect.repeat(
|
|
5203
5168
|
* Effect.gen(function*() {
|
|
5204
5169
|
* yield* Console.log("Performing health check...")
|
|
5205
|
-
*
|
|
5206
|
-
* return Math.random() > 0.7 ? "healthy" : "degraded"
|
|
5170
|
+
* return "healthy"
|
|
5207
5171
|
* }),
|
|
5208
5172
|
* alertingSchedule
|
|
5209
5173
|
* )
|
|
@@ -5215,14 +5179,14 @@ export const tapInput: {
|
|
|
5215
5179
|
* Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
|
|
5216
5180
|
* Schedule.tapOutput((count) =>
|
|
5217
5181
|
* count % 3 === 0
|
|
5218
|
-
* ? Console.log("
|
|
5182
|
+
* ? Console.log("Checkpoint reached")
|
|
5219
5183
|
* : Effect.void
|
|
5220
5184
|
* )
|
|
5221
5185
|
* )
|
|
5222
5186
|
* ```
|
|
5223
5187
|
*
|
|
5224
|
-
* @since 2.0.0
|
|
5225
5188
|
* @category sequencing
|
|
5189
|
+
* @since 2.0.0
|
|
5226
5190
|
*/
|
|
5227
5191
|
export const tapOutput: {
|
|
5228
5192
|
/**
|
|
@@ -5230,7 +5194,8 @@ export const tapOutput: {
|
|
|
5230
5194
|
* every output of the schedule, but does not alter the inputs and outputs of
|
|
5231
5195
|
* the schedule.
|
|
5232
5196
|
*
|
|
5233
|
-
*
|
|
5197
|
+
* **Example** (Tapping schedule outputs)
|
|
5198
|
+
*
|
|
5234
5199
|
* ```ts
|
|
5235
5200
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
5236
5201
|
*
|
|
@@ -5278,7 +5243,7 @@ export const tapOutput: {
|
|
|
5278
5243
|
* Effect.gen(function*() {
|
|
5279
5244
|
* const delayMs = delay.toString()
|
|
5280
5245
|
* if (delayMs.includes("1000")) { // Alert on delays >= 1 second
|
|
5281
|
-
* yield* Console.log(
|
|
5246
|
+
* yield* Console.log(`High delay detected: ${delay}`)
|
|
5282
5247
|
* }
|
|
5283
5248
|
* })
|
|
5284
5249
|
* )
|
|
@@ -5288,8 +5253,7 @@ export const tapOutput: {
|
|
|
5288
5253
|
* yield* Effect.repeat(
|
|
5289
5254
|
* Effect.gen(function*() {
|
|
5290
5255
|
* yield* Console.log("Performing health check...")
|
|
5291
|
-
*
|
|
5292
|
-
* return Math.random() > 0.7 ? "healthy" : "degraded"
|
|
5256
|
+
* return "healthy"
|
|
5293
5257
|
* }),
|
|
5294
5258
|
* alertingSchedule
|
|
5295
5259
|
* )
|
|
@@ -5301,14 +5265,14 @@ export const tapOutput: {
|
|
|
5301
5265
|
* Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
|
|
5302
5266
|
* Schedule.tapOutput((count) =>
|
|
5303
5267
|
* count % 3 === 0
|
|
5304
|
-
* ? Console.log("
|
|
5268
|
+
* ? Console.log("Checkpoint reached")
|
|
5305
5269
|
* : Effect.void
|
|
5306
5270
|
* )
|
|
5307
5271
|
* )
|
|
5308
5272
|
* ```
|
|
5309
5273
|
*
|
|
5310
|
-
* @since 2.0.0
|
|
5311
5274
|
* @category sequencing
|
|
5275
|
+
* @since 2.0.0
|
|
5312
5276
|
*/
|
|
5313
5277
|
<Output, X, Error2, Env2>(f: (output: Output) => Effect<X, Error2, Env2>): <Input, Error, Env>(
|
|
5314
5278
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -5318,7 +5282,8 @@ export const tapOutput: {
|
|
|
5318
5282
|
* every output of the schedule, but does not alter the inputs and outputs of
|
|
5319
5283
|
* the schedule.
|
|
5320
5284
|
*
|
|
5321
|
-
*
|
|
5285
|
+
* **Example** (Tapping schedule outputs)
|
|
5286
|
+
*
|
|
5322
5287
|
* ```ts
|
|
5323
5288
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
5324
5289
|
*
|
|
@@ -5366,7 +5331,7 @@ export const tapOutput: {
|
|
|
5366
5331
|
* Effect.gen(function*() {
|
|
5367
5332
|
* const delayMs = delay.toString()
|
|
5368
5333
|
* if (delayMs.includes("1000")) { // Alert on delays >= 1 second
|
|
5369
|
-
* yield* Console.log(
|
|
5334
|
+
* yield* Console.log(`High delay detected: ${delay}`)
|
|
5370
5335
|
* }
|
|
5371
5336
|
* })
|
|
5372
5337
|
* )
|
|
@@ -5376,8 +5341,7 @@ export const tapOutput: {
|
|
|
5376
5341
|
* yield* Effect.repeat(
|
|
5377
5342
|
* Effect.gen(function*() {
|
|
5378
5343
|
* yield* Console.log("Performing health check...")
|
|
5379
|
-
*
|
|
5380
|
-
* return Math.random() > 0.7 ? "healthy" : "degraded"
|
|
5344
|
+
* return "healthy"
|
|
5381
5345
|
* }),
|
|
5382
5346
|
* alertingSchedule
|
|
5383
5347
|
* )
|
|
@@ -5389,14 +5353,14 @@ export const tapOutput: {
|
|
|
5389
5353
|
* Schedule.tapOutput((count) => Console.log(`Execution ${count + 1}`)),
|
|
5390
5354
|
* Schedule.tapOutput((count) =>
|
|
5391
5355
|
* count % 3 === 0
|
|
5392
|
-
* ? Console.log("
|
|
5356
|
+
* ? Console.log("Checkpoint reached")
|
|
5393
5357
|
* : Effect.void
|
|
5394
5358
|
* )
|
|
5395
5359
|
* )
|
|
5396
5360
|
* ```
|
|
5397
5361
|
*
|
|
5398
|
-
* @since 2.0.0
|
|
5399
5362
|
* @category sequencing
|
|
5363
|
+
* @since 2.0.0
|
|
5400
5364
|
*/
|
|
5401
5365
|
<Output, Input, Error, Env, X, Error2, Env2>(
|
|
5402
5366
|
self: Schedule<Output, Input, Error, Env>,
|
|
@@ -5416,7 +5380,8 @@ export const tapOutput: {
|
|
|
5416
5380
|
* from the schedule. Once the specified number of outputs is reached, the
|
|
5417
5381
|
* schedule will stop.
|
|
5418
5382
|
*
|
|
5419
|
-
*
|
|
5383
|
+
* **Example** (Taking a limited number of recurrences)
|
|
5384
|
+
*
|
|
5420
5385
|
* ```ts
|
|
5421
5386
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
5422
5387
|
*
|
|
@@ -5430,7 +5395,7 @@ export const tapOutput: {
|
|
|
5430
5395
|
* const heartbeatProgram = Effect.gen(function*() {
|
|
5431
5396
|
* yield* Effect.repeat(
|
|
5432
5397
|
* Effect.gen(function*() {
|
|
5433
|
-
* yield* Console.log(
|
|
5398
|
+
* yield* Console.log("Heartbeat")
|
|
5434
5399
|
* return "pulse"
|
|
5435
5400
|
* }),
|
|
5436
5401
|
* limitedHeartbeat
|
|
@@ -5477,8 +5442,8 @@ export const tapOutput: {
|
|
|
5477
5442
|
* const samplingProgram = Effect.gen(function*() {
|
|
5478
5443
|
* yield* Effect.repeat(
|
|
5479
5444
|
* Effect.gen(function*() {
|
|
5480
|
-
* const value =
|
|
5481
|
-
* yield* Console.log(`Sampled value: ${value
|
|
5445
|
+
* const value = "sample"
|
|
5446
|
+
* yield* Console.log(`Sampled value: ${value}`)
|
|
5482
5447
|
* return value
|
|
5483
5448
|
* }),
|
|
5484
5449
|
* samplingSchedule.pipe(
|
|
@@ -5488,8 +5453,8 @@ export const tapOutput: {
|
|
|
5488
5453
|
* })
|
|
5489
5454
|
* ```
|
|
5490
5455
|
*
|
|
5491
|
-
* @
|
|
5492
|
-
* @
|
|
5456
|
+
* @category utils
|
|
5457
|
+
* @since 4.0.0
|
|
5493
5458
|
*/
|
|
5494
5459
|
export const take: {
|
|
5495
5460
|
/**
|
|
@@ -5497,7 +5462,8 @@ export const take: {
|
|
|
5497
5462
|
* from the schedule. Once the specified number of outputs is reached, the
|
|
5498
5463
|
* schedule will stop.
|
|
5499
5464
|
*
|
|
5500
|
-
*
|
|
5465
|
+
* **Example** (Taking a limited number of recurrences)
|
|
5466
|
+
*
|
|
5501
5467
|
* ```ts
|
|
5502
5468
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
5503
5469
|
*
|
|
@@ -5511,7 +5477,7 @@ export const take: {
|
|
|
5511
5477
|
* const heartbeatProgram = Effect.gen(function*() {
|
|
5512
5478
|
* yield* Effect.repeat(
|
|
5513
5479
|
* Effect.gen(function*() {
|
|
5514
|
-
* yield* Console.log(
|
|
5480
|
+
* yield* Console.log("Heartbeat")
|
|
5515
5481
|
* return "pulse"
|
|
5516
5482
|
* }),
|
|
5517
5483
|
* limitedHeartbeat
|
|
@@ -5558,8 +5524,8 @@ export const take: {
|
|
|
5558
5524
|
* const samplingProgram = Effect.gen(function*() {
|
|
5559
5525
|
* yield* Effect.repeat(
|
|
5560
5526
|
* Effect.gen(function*() {
|
|
5561
|
-
* const value =
|
|
5562
|
-
* yield* Console.log(`Sampled value: ${value
|
|
5527
|
+
* const value = "sample"
|
|
5528
|
+
* yield* Console.log(`Sampled value: ${value}`)
|
|
5563
5529
|
* return value
|
|
5564
5530
|
* }),
|
|
5565
5531
|
* samplingSchedule.pipe(
|
|
@@ -5569,8 +5535,8 @@ export const take: {
|
|
|
5569
5535
|
* })
|
|
5570
5536
|
* ```
|
|
5571
5537
|
*
|
|
5572
|
-
* @
|
|
5573
|
-
* @
|
|
5538
|
+
* @category utils
|
|
5539
|
+
* @since 4.0.0
|
|
5574
5540
|
*/
|
|
5575
5541
|
(n: number): <Output, Input, Error, Env>(
|
|
5576
5542
|
self: Schedule<Output, Input, Error, Env>
|
|
@@ -5580,7 +5546,8 @@ export const take: {
|
|
|
5580
5546
|
* from the schedule. Once the specified number of outputs is reached, the
|
|
5581
5547
|
* schedule will stop.
|
|
5582
5548
|
*
|
|
5583
|
-
*
|
|
5549
|
+
* **Example** (Taking a limited number of recurrences)
|
|
5550
|
+
*
|
|
5584
5551
|
* ```ts
|
|
5585
5552
|
* import { Console, Data, Effect, Schedule } from "effect"
|
|
5586
5553
|
*
|
|
@@ -5594,7 +5561,7 @@ export const take: {
|
|
|
5594
5561
|
* const heartbeatProgram = Effect.gen(function*() {
|
|
5595
5562
|
* yield* Effect.repeat(
|
|
5596
5563
|
* Effect.gen(function*() {
|
|
5597
|
-
* yield* Console.log(
|
|
5564
|
+
* yield* Console.log("Heartbeat")
|
|
5598
5565
|
* return "pulse"
|
|
5599
5566
|
* }),
|
|
5600
5567
|
* limitedHeartbeat
|
|
@@ -5641,8 +5608,8 @@ export const take: {
|
|
|
5641
5608
|
* const samplingProgram = Effect.gen(function*() {
|
|
5642
5609
|
* yield* Effect.repeat(
|
|
5643
5610
|
* Effect.gen(function*() {
|
|
5644
|
-
* const value =
|
|
5645
|
-
* yield* Console.log(`Sampled value: ${value
|
|
5611
|
+
* const value = "sample"
|
|
5612
|
+
* yield* Console.log(`Sampled value: ${value}`)
|
|
5646
5613
|
* return value
|
|
5647
5614
|
* }),
|
|
5648
5615
|
* samplingSchedule.pipe(
|
|
@@ -5652,8 +5619,8 @@ export const take: {
|
|
|
5652
5619
|
* })
|
|
5653
5620
|
* ```
|
|
5654
5621
|
*
|
|
5655
|
-
* @
|
|
5656
|
-
* @
|
|
5622
|
+
* @category utils
|
|
5623
|
+
* @since 4.0.0
|
|
5657
5624
|
*/
|
|
5658
5625
|
<Output, Input, Error, Env>(self: Schedule<Output, Input, Error, Env>, n: number): Schedule<Output, Input, Error, Env>
|
|
5659
5626
|
} = dual(2, <Output, Input, Error, Env>(
|
|
@@ -5665,7 +5632,8 @@ export const take: {
|
|
|
5665
5632
|
* Creates a schedule that unfolds a state by repeatedly applying a function,
|
|
5666
5633
|
* outputting the current state and computing the next state.
|
|
5667
5634
|
*
|
|
5668
|
-
*
|
|
5635
|
+
* **Example** (Unfolding schedule state)
|
|
5636
|
+
*
|
|
5669
5637
|
* ```ts
|
|
5670
5638
|
* import { Console, Effect, Schedule } from "effect"
|
|
5671
5639
|
*
|
|
@@ -5713,15 +5681,14 @@ export const take: {
|
|
|
5713
5681
|
* })
|
|
5714
5682
|
* )
|
|
5715
5683
|
*
|
|
5716
|
-
* //
|
|
5717
|
-
* const
|
|
5718
|
-
* 1000,
|
|
5719
|
-
* (
|
|
5684
|
+
* // Deterministic delay adjustment schedule
|
|
5685
|
+
* const adjustedDelaySchedule = Schedule.unfold(
|
|
5686
|
+
* { delay: 1000, adjustment: 100 },
|
|
5687
|
+
* ({ delay, adjustment }) =>
|
|
5720
5688
|
* Effect.gen(function*() {
|
|
5721
|
-
* const
|
|
5722
|
-
*
|
|
5723
|
-
*
|
|
5724
|
-
* return nextDelay
|
|
5689
|
+
* const nextDelay = Math.max(100, delay + adjustment)
|
|
5690
|
+
* yield* Console.log(`Adjusted delay: ${nextDelay}ms`)
|
|
5691
|
+
* return { delay: nextDelay, adjustment: adjustment * -1 }
|
|
5725
5692
|
* })
|
|
5726
5693
|
* )
|
|
5727
5694
|
*
|
|
@@ -5754,8 +5721,8 @@ export const take: {
|
|
|
5754
5721
|
* })
|
|
5755
5722
|
* ```
|
|
5756
5723
|
*
|
|
5757
|
-
* @since 2.0.0
|
|
5758
5724
|
* @category constructors
|
|
5725
|
+
* @since 2.0.0
|
|
5759
5726
|
*/
|
|
5760
5727
|
export const unfold = <State, Error = never, Env = never>(
|
|
5761
5728
|
initial: State,
|
|
@@ -5814,8 +5781,8 @@ export {
|
|
|
5814
5781
|
* If the `predicate` returns `true`, the schedule will continue, otherwise
|
|
5815
5782
|
* the schedule will stop.
|
|
5816
5783
|
*
|
|
5817
|
-
* @
|
|
5818
|
-
* @
|
|
5784
|
+
* @category utils
|
|
5785
|
+
* @since 4.0.0
|
|
5819
5786
|
*/
|
|
5820
5787
|
while_ as while
|
|
5821
5788
|
}
|
|
@@ -5833,7 +5800,8 @@ export {
|
|
|
5833
5800
|
* |action------|sleep---|act|-sleep|action----|
|
|
5834
5801
|
* ```
|
|
5835
5802
|
*
|
|
5836
|
-
*
|
|
5803
|
+
* **Example** (Repeating on aligned windows)
|
|
5804
|
+
*
|
|
5837
5805
|
* ```ts
|
|
5838
5806
|
* import { Console, Effect, Schedule } from "effect"
|
|
5839
5807
|
*
|
|
@@ -5843,8 +5811,7 @@ export {
|
|
|
5843
5811
|
* const program = Effect.gen(function*() {
|
|
5844
5812
|
* yield* Effect.repeat(
|
|
5845
5813
|
* Effect.gen(function*() {
|
|
5846
|
-
*
|
|
5847
|
-
* yield* Console.log(`Window task executed at: ${now}`)
|
|
5814
|
+
* yield* Console.log("Window task executed")
|
|
5848
5815
|
* return "window-task"
|
|
5849
5816
|
* }),
|
|
5850
5817
|
* windowSchedule.pipe(Schedule.take(4))
|
|
@@ -5852,8 +5819,8 @@ export {
|
|
|
5852
5819
|
* })
|
|
5853
5820
|
* ```
|
|
5854
5821
|
*
|
|
5855
|
-
* @since 2.0.0
|
|
5856
5822
|
* @category constructors
|
|
5823
|
+
* @since 2.0.0
|
|
5857
5824
|
*/
|
|
5858
5825
|
export const windowed = (interval: Duration.Input): Schedule<number> => {
|
|
5859
5826
|
const window = Duration.toMillis(Duration.fromInputUnsafe(interval))
|
|
@@ -5871,7 +5838,8 @@ export const windowed = (interval: Duration.Input): Schedule<number> => {
|
|
|
5871
5838
|
* The output of the schedule is the current count of its repetitions thus far
|
|
5872
5839
|
* (i.e. `0, 1, 2, ...`).
|
|
5873
5840
|
*
|
|
5874
|
-
*
|
|
5841
|
+
* **Example** (Repeating forever)
|
|
5842
|
+
*
|
|
5875
5843
|
* ```ts
|
|
5876
5844
|
* import { Console, Effect, Schedule } from "effect"
|
|
5877
5845
|
*
|
|
@@ -5889,8 +5857,8 @@ export const windowed = (interval: Duration.Input): Schedule<number> => {
|
|
|
5889
5857
|
* })
|
|
5890
5858
|
* ```
|
|
5891
5859
|
*
|
|
5892
|
-
* @since 2.0.0
|
|
5893
5860
|
* @category constructors
|
|
5861
|
+
* @since 2.0.0
|
|
5894
5862
|
*/
|
|
5895
5863
|
export const forever: Schedule<number> = spaced(Duration.zero)
|
|
5896
5864
|
|
|
@@ -5910,8 +5878,8 @@ export {
|
|
|
5910
5878
|
* without modification. It effectively acts as a pass-through that simply
|
|
5911
5879
|
* echoes its input values at each step.
|
|
5912
5880
|
*
|
|
5881
|
+
* @category constructors
|
|
5913
5882
|
* @since 2.0.0
|
|
5914
|
-
* @category Constructors
|
|
5915
5883
|
*/
|
|
5916
5884
|
identity_ as identity
|
|
5917
5885
|
}
|
|
@@ -5919,7 +5887,8 @@ export {
|
|
|
5919
5887
|
/**
|
|
5920
5888
|
* Ensures that the provided schedule respects a specified input type.
|
|
5921
5889
|
*
|
|
5922
|
-
*
|
|
5890
|
+
* **Example** (Constraining schedule input types)
|
|
5891
|
+
*
|
|
5923
5892
|
* ```ts
|
|
5924
5893
|
* import { Schedule } from "effect"
|
|
5925
5894
|
*
|
|
@@ -5938,8 +5907,8 @@ export {
|
|
|
5938
5907
|
* // where CustomType doesn't match the schedule's input type
|
|
5939
5908
|
* ```
|
|
5940
5909
|
*
|
|
5941
|
-
* @since 2.0.0
|
|
5942
5910
|
* @category ensuring types
|
|
5911
|
+
* @since 4.0.0
|
|
5943
5912
|
*/
|
|
5944
5913
|
export const satisfiesInputType = <T>() =>
|
|
5945
5914
|
<Input extends T, Output = never, Error = never, Env = never>(
|
|
@@ -5950,8 +5919,8 @@ export const satisfiesInputType = <T>() =>
|
|
|
5950
5919
|
* Sets the input type of the provided schedule to a specified type, without
|
|
5951
5920
|
* altering the schedule's behavior.
|
|
5952
5921
|
*
|
|
5953
|
-
* @since 2.0.0
|
|
5954
5922
|
* @category ensuring types
|
|
5923
|
+
* @since 4.0.0
|
|
5955
5924
|
*/
|
|
5956
5925
|
export const setInputType =
|
|
5957
5926
|
<T>() => <Output, Error, Env>(self: Schedule<Output, T, Error, Env>): Schedule<Output, T, Error, Env> => self
|
|
@@ -5959,7 +5928,8 @@ export const setInputType =
|
|
|
5959
5928
|
/**
|
|
5960
5929
|
* Ensures that the provided schedule respects a specified output type.
|
|
5961
5930
|
*
|
|
5962
|
-
*
|
|
5931
|
+
* **Example** (Constraining schedule output types)
|
|
5932
|
+
*
|
|
5963
5933
|
* ```ts
|
|
5964
5934
|
* import { Effect, Schedule } from "effect"
|
|
5965
5935
|
*
|
|
@@ -5973,8 +5943,8 @@ export const setInputType =
|
|
|
5973
5943
|
* )
|
|
5974
5944
|
* ```
|
|
5975
5945
|
*
|
|
5976
|
-
* @since 2.0.0
|
|
5977
5946
|
* @category ensuring types
|
|
5947
|
+
* @since 4.0.0
|
|
5978
5948
|
*/
|
|
5979
5949
|
export const satisfiesOutputType = <T>() =>
|
|
5980
5950
|
<Output extends T, Error = never, Input = unknown, Env = never>(
|
|
@@ -5984,7 +5954,8 @@ export const satisfiesOutputType = <T>() =>
|
|
|
5984
5954
|
/**
|
|
5985
5955
|
* Ensures that the provided schedule respects a specified error type.
|
|
5986
5956
|
*
|
|
5987
|
-
*
|
|
5957
|
+
* **Example** (Constraining schedule error types)
|
|
5958
|
+
*
|
|
5988
5959
|
* ```ts
|
|
5989
5960
|
* import { Data, Schedule } from "effect"
|
|
5990
5961
|
*
|
|
@@ -6004,8 +5975,8 @@ export const satisfiesOutputType = <T>() =>
|
|
|
6004
5975
|
* )
|
|
6005
5976
|
* ```
|
|
6006
5977
|
*
|
|
6007
|
-
* @since 2.0.0
|
|
6008
5978
|
* @category ensuring types
|
|
5979
|
+
* @since 4.0.0
|
|
6009
5980
|
*/
|
|
6010
5981
|
export const satisfiesErrorType = <T>() =>
|
|
6011
5982
|
<Error extends T, Output = never, Input = unknown, Env = never>(
|
|
@@ -6015,9 +5986,10 @@ export const satisfiesErrorType = <T>() =>
|
|
|
6015
5986
|
/**
|
|
6016
5987
|
* Ensures that the provided schedule respects a specified context type.
|
|
6017
5988
|
*
|
|
6018
|
-
*
|
|
5989
|
+
* **Example** (Constraining schedule service types)
|
|
5990
|
+
*
|
|
6019
5991
|
* ```ts
|
|
6020
|
-
* import { Schedule } from "effect"
|
|
5992
|
+
* import { Effect, Schedule } from "effect"
|
|
6021
5993
|
*
|
|
6022
5994
|
* // Define service interfaces (type-level only)
|
|
6023
5995
|
* interface Logger {
|
|
@@ -6025,7 +5997,7 @@ export const satisfiesErrorType = <T>() =>
|
|
|
6025
5997
|
* }
|
|
6026
5998
|
*
|
|
6027
5999
|
* interface Database {
|
|
6028
|
-
* readonly query: (sql: string) =>
|
|
6000
|
+
* readonly query: (sql: string) => Effect.Effect<ReadonlyArray<unknown>>
|
|
6029
6001
|
* }
|
|
6030
6002
|
*
|
|
6031
6003
|
* // Ensure schedule requires Logger service
|
|
@@ -6039,8 +6011,8 @@ export const satisfiesErrorType = <T>() =>
|
|
|
6039
6011
|
* )
|
|
6040
6012
|
* ```
|
|
6041
6013
|
*
|
|
6042
|
-
* @since 2.0.0
|
|
6043
6014
|
* @category ensuring types
|
|
6015
|
+
* @since 4.0.0
|
|
6044
6016
|
*/
|
|
6045
6017
|
export const satisfiesServicesType = <T>() =>
|
|
6046
6018
|
<Env extends T, Output = never, Input = unknown, Error = never>(
|