effect 2.0.0-next.46 → 2.0.0-next.48
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/BigInt/dist/effect-BigInt.cjs.d.mts +2 -0
- package/BigInt/dist/effect-BigInt.cjs.d.mts.map +1 -0
- package/BigInt/dist/effect-BigInt.cjs.d.ts +2 -0
- package/BigInt/dist/effect-BigInt.cjs.d.ts.map +1 -0
- package/{Bigint/dist/effect-Bigint.cjs.dev.js → BigInt/dist/effect-BigInt.cjs.dev.js} +30 -30
- package/BigInt/dist/effect-BigInt.cjs.js +7 -0
- package/{Bigint/dist/effect-Bigint.cjs.mjs → BigInt/dist/effect-BigInt.cjs.mjs} +2 -2
- package/{Bigint/dist/effect-Bigint.cjs.prod.js → BigInt/dist/effect-BigInt.cjs.prod.js} +30 -30
- package/{Bigint/dist/effect-Bigint.esm.js → BigInt/dist/effect-BigInt.esm.js} +28 -28
- package/BigInt/package.json +4 -0
- package/Brand/dist/effect-Brand.cjs.dev.js +3 -3
- package/Brand/dist/effect-Brand.cjs.prod.js +3 -3
- package/Cache/dist/effect-Cache.cjs.dev.js +28 -28
- package/Cache/dist/effect-Cache.cjs.prod.js +28 -28
- package/Cause/dist/effect-Cause.cjs.dev.js +8 -8
- package/Cause/dist/effect-Cause.cjs.prod.js +8 -8
- package/Channel/dist/effect-Channel.cjs.dev.js +41 -41
- package/Channel/dist/effect-Channel.cjs.prod.js +41 -41
- package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.dev.js +36 -38
- package/ChannelSingleProducerAsyncInput/dist/effect-ChannelSingleProducerAsyncInput.cjs.prod.js +36 -38
- package/Chunk/dist/effect-Chunk.cjs.dev.js +3 -3
- package/Chunk/dist/effect-Chunk.cjs.prod.js +3 -3
- package/Clock/dist/effect-Clock.cjs.dev.js +14 -14
- package/Clock/dist/effect-Clock.cjs.prod.js +14 -14
- package/Config/dist/effect-Config.cjs.dev.js +11 -11
- package/Config/dist/effect-Config.cjs.prod.js +11 -11
- package/ConfigError/dist/effect-ConfigError.cjs.dev.js +4 -4
- package/ConfigError/dist/effect-ConfigError.cjs.prod.js +4 -4
- package/ConfigProvider/dist/effect-ConfigProvider.cjs.dev.js +13 -13
- package/ConfigProvider/dist/effect-ConfigProvider.cjs.prod.js +13 -13
- package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.dev.js +5 -5
- package/ConfigProviderPathPatch/dist/effect-ConfigProviderPathPatch.cjs.prod.js +5 -5
- package/ConfigSecret/dist/effect-ConfigSecret.cjs.dev.js +4 -4
- package/ConfigSecret/dist/effect-ConfigSecret.cjs.prod.js +4 -4
- package/Console/dist/effect-Console.cjs.dev.js +32 -32
- package/Console/dist/effect-Console.cjs.prod.js +32 -32
- package/Context/dist/effect-Context.cjs.dev.js +3 -3
- package/Context/dist/effect-Context.cjs.prod.js +3 -3
- package/Data/dist/effect-Data.cjs.dev.js +50 -46
- package/Data/dist/effect-Data.cjs.prod.js +50 -46
- package/Data/dist/effect-Data.esm.js +11 -5
- package/DefaultServices/dist/effect-DefaultServices.cjs.dev.js +14 -14
- package/DefaultServices/dist/effect-DefaultServices.cjs.prod.js +14 -14
- package/Deferred/dist/effect-Deferred.cjs.dev.js +8 -8
- package/Deferred/dist/effect-Deferred.cjs.prod.js +8 -8
- package/Differ/dist/effect-Differ.cjs.dev.js +5 -5
- package/Differ/dist/effect-Differ.cjs.prod.js +5 -5
- package/Duration/dist/effect-Duration.cjs.dev.js +4 -4
- package/Duration/dist/effect-Duration.cjs.prod.js +4 -4
- package/Duration/dist/effect-Duration.esm.js +2 -2
- package/Effect/dist/effect-Effect.cjs.dev.js +67 -136
- package/Effect/dist/effect-Effect.cjs.mjs +2 -11
- package/Effect/dist/effect-Effect.cjs.prod.js +67 -136
- package/Effect/dist/effect-Effect.esm.js +30 -90
- package/Effectable/dist/effect-Effectable.cjs.dev.js +1 -1
- package/Effectable/dist/effect-Effectable.cjs.prod.js +1 -1
- package/Either/dist/effect-Either.cjs.dev.js +17 -3
- package/Either/dist/effect-Either.cjs.mjs +3 -1
- package/Either/dist/effect-Either.cjs.prod.js +17 -3
- package/Either/dist/effect-Either.esm.js +13 -1
- package/Encoding/dist/effect-Encoding.cjs.dev.js +3 -3
- package/Encoding/dist/effect-Encoding.cjs.prod.js +3 -3
- package/Exit/dist/effect-Exit.cjs.dev.js +8 -8
- package/Exit/dist/effect-Exit.cjs.prod.js +8 -8
- package/Fiber/dist/effect-Fiber.cjs.dev.js +29 -29
- package/Fiber/dist/effect-Fiber.cjs.prod.js +29 -29
- package/FiberId/dist/effect-FiberId.cjs.dev.js +5 -5
- package/FiberId/dist/effect-FiberId.cjs.prod.js +5 -5
- package/FiberRef/dist/effect-FiberRef.cjs.dev.js +29 -29
- package/FiberRef/dist/effect-FiberRef.cjs.prod.js +29 -29
- package/FiberRefs/dist/effect-FiberRefs.cjs.dev.js +9 -9
- package/FiberRefs/dist/effect-FiberRefs.cjs.prod.js +9 -9
- package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.dev.js +10 -10
- package/FiberRefsPatch/dist/effect-FiberRefsPatch.cjs.prod.js +10 -10
- package/GroupBy/dist/effect-GroupBy.cjs.dev.js +43 -43
- package/GroupBy/dist/effect-GroupBy.cjs.prod.js +43 -43
- package/HashMap/dist/effect-HashMap.cjs.dev.js +4 -4
- package/HashMap/dist/effect-HashMap.cjs.prod.js +4 -4
- package/HashSet/dist/effect-HashSet.cjs.dev.js +4 -4
- package/HashSet/dist/effect-HashSet.cjs.prod.js +4 -4
- package/KeyedPool/dist/effect-KeyedPool.cjs.dev.js +29 -29
- package/KeyedPool/dist/effect-KeyedPool.cjs.prod.js +29 -29
- package/Layer/dist/effect-Layer.cjs.dev.js +151 -52
- package/Layer/dist/effect-Layer.cjs.mjs +12 -0
- package/Layer/dist/effect-Layer.cjs.prod.js +151 -52
- package/Layer/dist/effect-Layer.esm.js +92 -2
- package/List/dist/effect-List.cjs.dev.js +3 -3
- package/List/dist/effect-List.cjs.prod.js +3 -3
- package/LogLevel/dist/effect-LogLevel.cjs.dev.js +8 -8
- package/LogLevel/dist/effect-LogLevel.cjs.prod.js +8 -8
- package/Logger/dist/effect-Logger.cjs.dev.js +33 -39
- package/Logger/dist/effect-Logger.cjs.prod.js +33 -39
- package/Logger/dist/effect-Logger.esm.js +0 -5
- package/Match/dist/effect-Match.cjs.d.mts +2 -0
- package/Match/dist/effect-Match.cjs.d.mts.map +1 -0
- package/Match/dist/effect-Match.cjs.d.ts +2 -0
- package/Match/dist/effect-Match.cjs.d.ts.map +1 -0
- package/Match/dist/effect-Match.cjs.dev.js +620 -0
- package/Match/dist/effect-Match.cjs.js +7 -0
- package/Match/dist/effect-Match.cjs.mjs +39 -0
- package/Match/dist/effect-Match.cjs.prod.js +620 -0
- package/Match/dist/effect-Match.esm.js +258 -0
- package/Match/package.json +4 -0
- package/Metric/dist/effect-Metric.cjs.dev.js +27 -27
- package/Metric/dist/effect-Metric.cjs.prod.js +27 -27
- package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.dev.js +4 -4
- package/MetricBoundaries/dist/effect-MetricBoundaries.cjs.prod.js +4 -4
- package/MetricHook/dist/effect-MetricHook.cjs.dev.js +6 -6
- package/MetricHook/dist/effect-MetricHook.cjs.prod.js +6 -6
- package/MetricKey/dist/effect-MetricKey.cjs.dev.js +7 -7
- package/MetricKey/dist/effect-MetricKey.cjs.prod.js +7 -7
- package/MetricKeyType/dist/effect-MetricKeyType.cjs.dev.js +4 -4
- package/MetricKeyType/dist/effect-MetricKeyType.cjs.prod.js +4 -4
- package/MetricLabel/dist/effect-MetricLabel.cjs.dev.js +1 -1
- package/MetricLabel/dist/effect-MetricLabel.cjs.prod.js +1 -1
- package/MetricPolling/dist/effect-MetricPolling.cjs.dev.js +29 -29
- package/MetricPolling/dist/effect-MetricPolling.cjs.prod.js +29 -29
- package/MetricRegistry/dist/effect-MetricRegistry.cjs.dev.js +8 -8
- package/MetricRegistry/dist/effect-MetricRegistry.cjs.prod.js +8 -8
- package/MetricState/dist/effect-MetricState.cjs.dev.js +1 -1
- package/MetricState/dist/effect-MetricState.cjs.prod.js +1 -1
- package/MutableHashMap/dist/effect-MutableHashMap.cjs.dev.js +4 -4
- package/MutableHashMap/dist/effect-MutableHashMap.cjs.prod.js +4 -4
- package/MutableHashSet/dist/effect-MutableHashSet.cjs.dev.js +4 -4
- package/MutableHashSet/dist/effect-MutableHashSet.cjs.prod.js +4 -4
- package/MutableQueue/dist/effect-MutableQueue.cjs.dev.js +3 -3
- package/MutableQueue/dist/effect-MutableQueue.cjs.prod.js +3 -3
- package/Option/dist/effect-Option.cjs.dev.js +3 -3
- package/Option/dist/effect-Option.cjs.prod.js +3 -3
- package/Pool/dist/effect-Pool.cjs.dev.js +29 -29
- package/Pool/dist/effect-Pool.cjs.prod.js +29 -29
- package/Predicate/dist/effect-Predicate.cjs.dev.js +5 -5
- package/Predicate/dist/effect-Predicate.cjs.mjs +1 -1
- package/Predicate/dist/effect-Predicate.cjs.prod.js +5 -5
- package/Predicate/dist/effect-Predicate.esm.js +5 -5
- package/PubSub/dist/effect-PubSub.cjs.dev.js +28 -28
- package/PubSub/dist/effect-PubSub.cjs.prod.js +28 -28
- package/Queue/dist/effect-Queue.cjs.dev.js +28 -28
- package/Queue/dist/effect-Queue.cjs.prod.js +28 -28
- package/README.md +23 -0
- package/Random/dist/effect-Random.cjs.dev.js +14 -14
- package/Random/dist/effect-Random.cjs.prod.js +14 -14
- package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.dev.js +3 -3
- package/ReadonlyArray/dist/effect-ReadonlyArray.cjs.prod.js +3 -3
- package/ReadonlyRecord/dist/effect-ReadonlyRecord.cjs.dev.js +3 -3
- package/ReadonlyRecord/dist/effect-ReadonlyRecord.cjs.prod.js +3 -3
- package/RedBlackTree/dist/effect-RedBlackTree.cjs.dev.js +3 -3
- package/RedBlackTree/dist/effect-RedBlackTree.cjs.prod.js +3 -3
- package/Ref/dist/effect-Ref.cjs.dev.js +9 -9
- package/Ref/dist/effect-Ref.cjs.prod.js +9 -9
- package/Reloadable/dist/effect-Reloadable.cjs.dev.js +33 -33
- package/Reloadable/dist/effect-Reloadable.cjs.prod.js +33 -33
- package/Request/dist/effect-Request.cjs.dev.js +28 -28
- package/Request/dist/effect-Request.cjs.prod.js +28 -28
- package/RequestBlock/dist/effect-RequestBlock.cjs.dev.js +36 -38
- package/RequestBlock/dist/effect-RequestBlock.cjs.prod.js +36 -38
- package/RequestResolver/dist/effect-RequestResolver.cjs.dev.js +42 -44
- package/RequestResolver/dist/effect-RequestResolver.cjs.prod.js +42 -44
- package/Resource/dist/effect-Resource.cjs.dev.js +31 -31
- package/Resource/dist/effect-Resource.cjs.prod.js +31 -31
- package/Runtime/dist/effect-Runtime.cjs.dev.js +30 -30
- package/Runtime/dist/effect-Runtime.cjs.prod.js +30 -30
- package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.dev.js +33 -34
- package/RuntimeFlags/dist/effect-RuntimeFlags.cjs.prod.js +33 -34
- package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.dev.js +6 -6
- package/RuntimeFlagsPatch/dist/effect-RuntimeFlagsPatch.cjs.prod.js +6 -6
- package/STM/dist/effect-STM.cjs.dev.js +45 -45
- package/STM/dist/effect-STM.cjs.prod.js +45 -45
- package/Schedule/dist/effect-Schedule.cjs.dev.js +20 -20
- package/Schedule/dist/effect-Schedule.cjs.prod.js +20 -20
- package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.dev.js +3 -3
- package/ScheduleDecision/dist/effect-ScheduleDecision.cjs.prod.js +3 -3
- package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.dev.js +3 -3
- package/ScheduleInterval/dist/effect-ScheduleInterval.cjs.prod.js +3 -3
- package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.dev.js +3 -3
- package/ScheduleIntervals/dist/effect-ScheduleIntervals.cjs.prod.js +3 -3
- package/Scheduler/dist/effect-Scheduler.cjs.dev.js +8 -8
- package/Scheduler/dist/effect-Scheduler.cjs.prod.js +8 -8
- package/Scope/dist/effect-Scope.cjs.dev.js +27 -27
- package/Scope/dist/effect-Scope.cjs.prod.js +27 -27
- package/ScopedCache/dist/effect-ScopedCache.cjs.dev.js +34 -36
- package/ScopedCache/dist/effect-ScopedCache.cjs.prod.js +34 -36
- package/ScopedRef/dist/effect-ScopedRef.cjs.dev.js +31 -31
- package/ScopedRef/dist/effect-ScopedRef.cjs.prod.js +31 -31
- package/Sink/dist/effect-Sink.cjs.dev.js +39 -39
- package/Sink/dist/effect-Sink.cjs.prod.js +39 -39
- package/SortedMap/dist/effect-SortedMap.cjs.dev.js +3 -3
- package/SortedMap/dist/effect-SortedMap.cjs.prod.js +3 -3
- package/SortedSet/dist/effect-SortedSet.cjs.dev.js +3 -3
- package/SortedSet/dist/effect-SortedSet.cjs.prod.js +3 -3
- package/Stream/dist/effect-Stream.cjs.dev.js +43 -43
- package/Stream/dist/effect-Stream.cjs.prod.js +43 -43
- package/Streamable/dist/effect-Streamable.cjs.dev.js +43 -43
- package/Streamable/dist/effect-Streamable.cjs.prod.js +43 -43
- package/String/dist/effect-String.cjs.dev.js +3 -3
- package/String/dist/effect-String.cjs.prod.js +3 -3
- package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.dev.js +46 -46
- package/SubscriptionRef/dist/effect-SubscriptionRef.cjs.prod.js +46 -46
- package/Supervisor/dist/effect-Supervisor.cjs.dev.js +33 -34
- package/Supervisor/dist/effect-Supervisor.cjs.prod.js +33 -34
- package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.dev.js +30 -30
- package/SynchronizedRef/dist/effect-SynchronizedRef.cjs.prod.js +30 -30
- package/TArray/dist/effect-TArray.cjs.dev.js +47 -47
- package/TArray/dist/effect-TArray.cjs.prod.js +47 -47
- package/TDeferred/dist/effect-TDeferred.cjs.dev.js +46 -46
- package/TDeferred/dist/effect-TDeferred.cjs.prod.js +46 -46
- package/TMap/dist/effect-TMap.cjs.dev.js +48 -48
- package/TMap/dist/effect-TMap.cjs.prod.js +48 -48
- package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.dev.js +45 -45
- package/TPriorityQueue/dist/effect-TPriorityQueue.cjs.prod.js +45 -45
- package/TPubSub/dist/effect-TPubSub.cjs.dev.js +50 -50
- package/TPubSub/dist/effect-TPubSub.cjs.prod.js +50 -50
- package/TQueue/dist/effect-TQueue.cjs.dev.js +47 -47
- package/TQueue/dist/effect-TQueue.cjs.prod.js +47 -47
- package/TRandom/dist/effect-TRandom.cjs.dev.js +46 -46
- package/TRandom/dist/effect-TRandom.cjs.prod.js +46 -46
- package/TReentrantLock/dist/effect-TReentrantLock.cjs.dev.js +50 -50
- package/TReentrantLock/dist/effect-TReentrantLock.cjs.prod.js +50 -50
- package/TRef/dist/effect-TRef.cjs.dev.js +45 -45
- package/TRef/dist/effect-TRef.cjs.prod.js +45 -45
- package/TSemaphore/dist/effect-TSemaphore.cjs.dev.js +46 -46
- package/TSemaphore/dist/effect-TSemaphore.cjs.prod.js +46 -46
- package/TSet/dist/effect-TSet.cjs.dev.js +48 -48
- package/TSet/dist/effect-TSet.cjs.prod.js +48 -48
- package/Take/dist/effect-Take.cjs.dev.js +36 -38
- package/Take/dist/effect-Take.cjs.prod.js +36 -38
- package/TestAnnotation/dist/effect-TestAnnotation.cjs.dev.js +5 -5
- package/TestAnnotation/dist/effect-TestAnnotation.cjs.prod.js +5 -5
- package/TestAnnotations/dist/effect-TestAnnotations.cjs.dev.js +20 -20
- package/TestAnnotations/dist/effect-TestAnnotations.cjs.prod.js +20 -20
- package/TestClock/dist/effect-TestClock.cjs.dev.js +32 -32
- package/TestClock/dist/effect-TestClock.cjs.prod.js +32 -32
- package/TestConfig/dist/effect-TestConfig.cjs.dev.js +3 -3
- package/TestConfig/dist/effect-TestConfig.cjs.prod.js +3 -3
- package/TestContext/dist/effect-TestContext.cjs.dev.js +34 -36
- package/TestContext/dist/effect-TestContext.cjs.prod.js +34 -36
- package/TestLive/dist/effect-TestLive.cjs.dev.js +14 -14
- package/TestLive/dist/effect-TestLive.cjs.prod.js +14 -14
- package/TestServices/dist/effect-TestServices.cjs.dev.js +40 -42
- package/TestServices/dist/effect-TestServices.cjs.prod.js +40 -42
- package/TestSized/dist/effect-TestSized.cjs.dev.js +8 -8
- package/TestSized/dist/effect-TestSized.cjs.prod.js +8 -8
- package/Tracer/dist/effect-Tracer.cjs.dev.js +20 -18
- package/Tracer/dist/effect-Tracer.cjs.mjs +1 -0
- package/Tracer/dist/effect-Tracer.cjs.prod.js +20 -18
- package/Tracer/dist/effect-Tracer.esm.js +7 -6
- package/dist/{Context-da73ddfa.cjs.dev.js → Context-607e9b4c.cjs.dev.js} +2 -2
- package/dist/{Context-9fe5eb16.cjs.prod.js → Context-c91d8ca0.cjs.prod.js} +2 -2
- package/dist/{Either-d43f082c.cjs.prod.js → Either-a3f96c60.cjs.prod.js} +2 -2
- package/dist/{Either-fa0ef1d9.cjs.dev.js → Either-e7500e90.cjs.dev.js} +2 -2
- package/dist/{Option-463b42e6.cjs.dev.js → Option-01caa9d4.cjs.dev.js} +1 -1
- package/dist/{Option-935e5d7c.cjs.prod.js → Option-dd52e82a.cjs.prod.js} +1 -1
- package/dist/{Ref-acdee7ef.cjs.dev.js → Ref-548003d1.cjs.dev.js} +1 -1
- package/dist/{Ref-4014b526.cjs.prod.js → Ref-6608e3b6.cjs.prod.js} +1 -1
- package/dist/{cache-7eed9d33.cjs.dev.js → cache-7953c9ae.cjs.dev.js} +5 -5
- package/dist/{cache-5c7d77e4.cjs.prod.js → cache-d7096ab5.cjs.prod.js} +5 -5
- package/dist/{circular-c8b65bdb.cjs.dev.js → circular-171d6971.cjs.dev.js} +8 -9
- package/dist/{circular-c2dbce1a.cjs.dev.js → circular-8568ddf2.cjs.dev.js} +7 -7
- package/dist/{circular-1f481ffb.cjs.prod.js → circular-894f44de.cjs.prod.js} +7 -7
- package/dist/{circular-9e10a5a7.cjs.prod.js → circular-b6cc8a1d.cjs.prod.js} +8 -9
- package/dist/{config-5ba54da1.cjs.prod.js → config-615bcaef.cjs.prod.js} +3 -3
- package/dist/{config-3b7935a3.cjs.dev.js → config-ea74e7d0.cjs.dev.js} +3 -3
- package/dist/{configProvider-f34a82f1.cjs.dev.js → configProvider-089a1159.cjs.dev.js} +4 -4
- package/dist/{configProvider-b6b20998.cjs.prod.js → configProvider-3877a6ec.cjs.prod.js} +4 -4
- package/dist/{core-b7401357.cjs.dev.js → core-365f89c2.cjs.dev.js} +3 -3
- package/dist/{core-07202cc0.cjs.prod.js → core-3908bc43.cjs.prod.js} +3 -3
- package/dist/{core-c5747f88.cjs.dev.js → core-3d37486a.cjs.dev.js} +3 -3
- package/dist/{core-7411d1e1.cjs.prod.js → core-8ccae4e2.cjs.prod.js} +3 -3
- package/dist/{core-effect-9201ea63.cjs.prod.js → core-effect-37a0d753.cjs.prod.js} +8 -8
- package/dist/{core-effect-1c564d42.cjs.dev.js → core-effect-c529ccac.cjs.dev.js} +8 -8
- package/dist/{dataSource-b83bc277.cjs.prod.js → dataSource-0e407d86.cjs.prod.js} +2 -2
- package/dist/{dataSource-b5eda714.cjs.dev.js → dataSource-d125d7af.cjs.dev.js} +2 -2
- package/dist/declarations/src/{Bigint.d.ts → BigInt.d.ts} +27 -27
- package/dist/declarations/src/{Bigint.d.ts.map → BigInt.d.ts.map} +1 -1
- package/dist/declarations/src/Channel.d.ts +4 -2
- package/dist/declarations/src/Channel.d.ts.map +1 -1
- package/dist/declarations/src/Data.d.ts +1 -2
- package/dist/declarations/src/Data.d.ts.map +1 -1
- package/dist/declarations/src/Effect.d.ts +67 -102
- package/dist/declarations/src/Effect.d.ts.map +1 -1
- package/dist/declarations/src/Either.d.ts +16 -0
- package/dist/declarations/src/Either.d.ts.map +1 -1
- package/dist/declarations/src/FiberRef.d.ts +2 -2
- package/dist/declarations/src/FiberRef.d.ts.map +1 -1
- package/dist/declarations/src/Layer.d.ts +98 -3
- package/dist/declarations/src/Layer.d.ts.map +1 -1
- package/dist/declarations/src/Logger.d.ts +2 -7
- package/dist/declarations/src/Logger.d.ts.map +1 -1
- package/dist/declarations/src/Match.d.ts +420 -0
- package/dist/declarations/src/Match.d.ts.map +1 -0
- package/dist/declarations/src/Predicate.d.ts +4 -4
- package/dist/declarations/src/Queue.d.ts +5 -0
- package/dist/declarations/src/Queue.d.ts.map +1 -1
- package/dist/declarations/src/Stream.d.ts +4 -2
- package/dist/declarations/src/Stream.d.ts.map +1 -1
- package/dist/declarations/src/Tracer.d.ts +17 -10
- package/dist/declarations/src/Tracer.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +5 -1
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/{defaultServices-9d7ce86f.cjs.prod.js → defaultServices-1c3db777.cjs.prod.js} +15 -4
- package/dist/{defaultServices-755d5b46.cjs.dev.js → defaultServices-a933c201.cjs.dev.js} +15 -4
- package/dist/effect.cjs.dev.js +6 -3
- package/dist/effect.cjs.mjs +2 -1
- package/dist/effect.cjs.prod.js +6 -3
- package/dist/effect.esm.js +4 -2
- package/dist/{fiber-5156eff2.cjs.dev.js → fiber-13587a5a.cjs.dev.js} +3 -3
- package/dist/{fiber-9519d109.cjs.prod.js → fiber-2858bd1f.cjs.prod.js} +3 -3
- package/dist/{fiberRefs-98b71233.cjs.dev.js → fiberRefs-abe2a811.cjs.dev.js} +1 -1
- package/dist/{fiberRefs-558c17e6.cjs.prod.js → fiberRefs-ea1edd57.cjs.prod.js} +1 -1
- package/dist/{fiberRuntime-31ae011f.cjs.prod.js → fiberRuntime-9fafeaab.cjs.prod.js} +27 -23
- package/dist/{fiberRuntime-d3872282.cjs.dev.js → fiberRuntime-ebcb168f.cjs.dev.js} +27 -23
- package/dist/{groupBy-862cc2da.cjs.dev.js → groupBy-050e6b17.cjs.dev.js} +4 -4
- package/dist/{groupBy-724f64ef.cjs.prod.js → groupBy-93f35a1d.cjs.prod.js} +4 -4
- package/dist/{hook-8cefc909.cjs.dev.js → hook-2c94278c.cjs.dev.js} +1 -1
- package/dist/{hook-98ce30e4.cjs.prod.js → hook-9af5cf52.cjs.prod.js} +1 -1
- package/dist/{key-198b6670.cjs.dev.js → key-2d4efb00.cjs.dev.js} +2 -2
- package/dist/{key-eb8a12b2.cjs.prod.js → key-9b2f3322.cjs.prod.js} +2 -2
- package/dist/{layer-29574350.cjs.dev.js → layer-09807eda.cjs.dev.js} +15 -10
- package/dist/{layer-51ff4846.cjs.prod.js → layer-fc5b5ca7.cjs.prod.js} +15 -10
- package/dist/{patch-0220a642.cjs.dev.js → patch-2f545954.cjs.dev.js} +1 -1
- package/dist/{patch-7c559bb2.cjs.prod.js → patch-e72c6c2f.cjs.prod.js} +1 -1
- package/dist/{pathPatch-fab016f1.cjs.dev.js → pathPatch-9fa78980.cjs.dev.js} +1 -1
- package/dist/{pathPatch-b56a4da2.cjs.prod.js → pathPatch-f3064fa9.cjs.prod.js} +1 -1
- package/dist/{pool-3211287f.cjs.dev.js → pool-7c9cd8e9.cjs.dev.js} +5 -5
- package/dist/{pool-f77d7705.cjs.prod.js → pool-9370f703.cjs.prod.js} +5 -5
- package/dist/{query-c36decd5.cjs.dev.js → query-6cd164ab.cjs.dev.js} +3 -3
- package/dist/{query-a52b25f0.cjs.prod.js → query-8147932f.cjs.prod.js} +3 -3
- package/dist/{queue-7a223c44.cjs.dev.js → queue-06ce789d.cjs.dev.js} +23 -13
- package/dist/{queue-315ea45d.cjs.prod.js → queue-6afe5f19.cjs.prod.js} +23 -13
- package/dist/{registry-62ff192e.cjs.dev.js → registry-35e8eb48.cjs.dev.js} +2 -2
- package/dist/{registry-d5258dff.cjs.prod.js → registry-5c67df33.cjs.prod.js} +2 -2
- package/dist/{runtime-005f8a9b.cjs.prod.js → runtime-d41d839b.cjs.prod.js} +6 -6
- package/dist/{runtime-57c8ddf8.cjs.dev.js → runtime-fb1c1c19.cjs.dev.js} +6 -6
- package/dist/{schedule-e7a9f93f.cjs.dev.js → schedule-0e1db444.cjs.dev.js} +3 -3
- package/dist/{schedule-8cdf6bf1.cjs.prod.js → schedule-64057679.cjs.prod.js} +3 -3
- package/dist/{scopedRef-eb19c7a6.cjs.dev.js → scopedRef-2ea09a4f.cjs.dev.js} +6 -6
- package/dist/{scopedRef-789d7fef.cjs.prod.js → scopedRef-7a6d42f7.cjs.prod.js} +6 -6
- package/dist/{singleProducerAsyncInput-f9b258b1.cjs.prod.js → singleProducerAsyncInput-8b8ad112.cjs.prod.js} +1 -1
- package/dist/{singleProducerAsyncInput-9ff8389b.cjs.dev.js → singleProducerAsyncInput-97f74016.cjs.dev.js} +1 -1
- package/dist/{sink-572d8981.cjs.prod.js → sink-6d1a77bf.cjs.prod.js} +3 -3
- package/dist/{sink-8d3427e7.cjs.dev.js → sink-ebf2fbdb.cjs.dev.js} +3 -3
- package/dist/{stm-f250b596.cjs.prod.js → stm-4a6de085.cjs.prod.js} +3 -3
- package/dist/{stm-8aca0022.cjs.dev.js → stm-dbec85f1.cjs.dev.js} +3 -3
- package/dist/{stream-34d80d2c.cjs.dev.js → stream-478aa5a8.cjs.dev.js} +9 -6
- package/dist/{stream-ea4f4d44.cjs.prod.js → stream-f7345889.cjs.prod.js} +9 -6
- package/dist/{synchronizedRef-ed8aa6ac.cjs.prod.js → synchronizedRef-432b4455.cjs.prod.js} +1 -1
- package/dist/{synchronizedRef-a12fd967.cjs.dev.js → synchronizedRef-fa63e917.cjs.dev.js} +1 -1
- package/dist/{tArray-17f078f2.cjs.dev.js → tArray-0c9045e7.cjs.dev.js} +3 -3
- package/dist/{tArray-d184e22f.cjs.prod.js → tArray-b30ccc3e.cjs.prod.js} +3 -3
- package/dist/{tMap-e219f30e.cjs.prod.js → tMap-001c791c.cjs.prod.js} +4 -4
- package/dist/{tMap-1a5aa78b.cjs.dev.js → tMap-0625df1d.cjs.dev.js} +4 -4
- package/dist/{tQueue-47129ad0.cjs.prod.js → tQueue-6accdd70.cjs.prod.js} +3 -3
- package/dist/{tQueue-0a4fc773.cjs.dev.js → tQueue-cdbf9130.cjs.dev.js} +3 -3
- package/dist/{tRef-ab4c5713.cjs.prod.js → tRef-8b60d85b.cjs.prod.js} +1 -1
- package/dist/{tRef-b860ef05.cjs.dev.js → tRef-b5bae36d.cjs.dev.js} +1 -1
- package/internal/channel.esm.js +2 -2
- package/internal/core-effect.esm.js +1 -1
- package/internal/fiberRuntime.esm.js +27 -23
- package/internal/layer/circular.esm.js +5 -6
- package/internal/layer.esm.js +9 -5
- package/internal/logger.esm.js +3 -3
- package/internal/matcher.esm.js +314 -0
- package/internal/queue.esm.js +24 -14
- package/internal/stream.esm.js +7 -4
- package/internal/tracer.esm.js +14 -4
- package/package.json +21 -13
- package/src/{Bigint.ts → BigInt.ts} +26 -26
- package/src/Channel.ts +4 -2
- package/src/Data.ts +18 -16
- package/src/Duration.ts +2 -2
- package/src/Effect.ts +84 -151
- package/src/Either.ts +33 -0
- package/src/FiberRef.ts +2 -3
- package/src/Layer.ts +157 -3
- package/src/Logger.ts +2 -8
- package/src/Match.ts +800 -0
- package/src/Predicate.ts +4 -4
- package/src/Queue.ts +8 -0
- package/src/Stream.ts +4 -2
- package/src/Tracer.ts +18 -9
- package/src/index.ts +6 -1
- package/src/internal/channel.ts +5 -3
- package/src/internal/core-effect.ts +27 -22
- package/src/internal/core.ts +5 -7
- package/src/internal/fiberRuntime.ts +39 -13
- package/src/internal/layer/circular.ts +21 -6
- package/src/internal/layer.ts +20 -4
- package/src/internal/logger.ts +4 -4
- package/src/internal/matcher.ts +594 -0
- package/src/internal/queue.ts +26 -11
- package/src/internal/stream.ts +9 -7
- package/src/internal/tracer.ts +28 -5
- package/src/tsconfig.json +41 -0
- package/Bigint/dist/effect-Bigint.cjs.d.mts +0 -2
- package/Bigint/dist/effect-Bigint.cjs.d.mts.map +0 -1
- package/Bigint/dist/effect-Bigint.cjs.d.ts +0 -2
- package/Bigint/dist/effect-Bigint.cjs.d.ts.map +0 -1
- package/Bigint/dist/effect-Bigint.cjs.js +0 -7
- package/Bigint/package.json +0 -4
- /package/dist/{Effectable-c4c14a2b.cjs.prod.js → Effectable-6a8a05f1.cjs.prod.js} +0 -0
- /package/dist/{Effectable-7314aed8.cjs.dev.js → Effectable-71c10ab9.cjs.dev.js} +0 -0
- /package/dist/{FiberId-1d7ac632.cjs.prod.js → FiberId-54d8bd67.cjs.prod.js} +0 -0
- /package/dist/{FiberId-d88ddce6.cjs.dev.js → FiberId-6708cdca.cjs.dev.js} +0 -0
- /package/dist/{HashSet-ac02a3e1.cjs.prod.js → HashSet-86613304.cjs.prod.js} +0 -0
- /package/dist/{HashSet-5963ad6b.cjs.dev.js → HashSet-dd020cb0.cjs.dev.js} +0 -0
- /package/dist/{RuntimeFlagsPatch-866fa259.cjs.prod.js → RuntimeFlagsPatch-902b4680.cjs.prod.js} +0 -0
- /package/dist/{RuntimeFlagsPatch-69102b03.cjs.dev.js → RuntimeFlagsPatch-cf423492.cjs.dev.js} +0 -0
- /package/dist/{boundaries-f212e414.cjs.dev.js → boundaries-b5265184.cjs.dev.js} +0 -0
- /package/dist/{boundaries-9af538e3.cjs.prod.js → boundaries-bfd86b3e.cjs.prod.js} +0 -0
- /package/dist/{configError-b43723af.cjs.prod.js → configError-856c7153.cjs.prod.js} +0 -0
- /package/dist/{configError-d5efe9c0.cjs.dev.js → configError-a824b415.cjs.dev.js} +0 -0
- /package/dist/{configSecret-e2faa181.cjs.prod.js → configSecret-9b941a86.cjs.prod.js} +0 -0
- /package/dist/{configSecret-3e8ae336.cjs.dev.js → configSecret-e7bb51da.cjs.dev.js} +0 -0
- /package/dist/{keyType-0c5e6178.cjs.prod.js → keyType-4ec0b247.cjs.prod.js} +0 -0
- /package/dist/{keyType-7c164b82.cjs.dev.js → keyType-f30c9fa4.cjs.dev.js} +0 -0
- /package/dist/{label-655343b5.cjs.prod.js → label-a588e6cd.cjs.prod.js} +0 -0
- /package/dist/{label-011edbe7.cjs.dev.js → label-b0cebeae.cjs.dev.js} +0 -0
- /package/dist/{state-0bdf02b7.cjs.prod.js → state-40d5dc71.cjs.prod.js} +0 -0
- /package/dist/{state-931050c4.cjs.dev.js → state-620f7a22.cjs.dev.js} +0 -0
- /package/dist/{take-85daaf79.cjs.prod.js → take-15455ae3.cjs.prod.js} +0 -0
- /package/dist/{take-f9ef9e2e.cjs.dev.js → take-1c250e7a.cjs.dev.js} +0 -0
package/src/Predicate.ts
CHANGED
|
@@ -110,16 +110,16 @@ export const isBoolean = (input: unknown): input is boolean => typeof input ===
|
|
|
110
110
|
* @param input - The value to test.
|
|
111
111
|
*
|
|
112
112
|
* @example
|
|
113
|
-
* import {
|
|
113
|
+
* import { isBigInt } from "effect/Predicate"
|
|
114
114
|
*
|
|
115
|
-
* assert.deepStrictEqual(
|
|
115
|
+
* assert.deepStrictEqual(isBigInt(1n), true)
|
|
116
116
|
*
|
|
117
|
-
* assert.deepStrictEqual(
|
|
117
|
+
* assert.deepStrictEqual(isBigInt(1), false)
|
|
118
118
|
*
|
|
119
119
|
* @category guards
|
|
120
120
|
* @since 2.0.0
|
|
121
121
|
*/
|
|
122
|
-
export const
|
|
122
|
+
export const isBigInt = (input: unknown): input is bigint => typeof input === "bigint"
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Tests if a value is a `symbol`.
|
package/src/Queue.ts
CHANGED
|
@@ -216,6 +216,14 @@ export interface Strategy<A> extends Queue.StrategyVariance<A> {
|
|
|
216
216
|
isShutdown: MutableRef.MutableRef<boolean>
|
|
217
217
|
): Effect.Effect<never, never, boolean>
|
|
218
218
|
|
|
219
|
+
/**
|
|
220
|
+
* It is called when the backing queue is empty but there are some
|
|
221
|
+
* takers that can be completed
|
|
222
|
+
*/
|
|
223
|
+
onCompleteTakersWithEmptyQueue(
|
|
224
|
+
takers: MutableQueue.MutableQueue<Deferred.Deferred<never, A>>
|
|
225
|
+
): void
|
|
226
|
+
|
|
219
227
|
/**
|
|
220
228
|
* Determines the behavior of the `Queue.Strategy` when the `Queue` has empty
|
|
221
229
|
* slots following a `take` operation.
|
package/src/Stream.ts
CHANGED
|
@@ -4000,10 +4000,11 @@ export const withSpan: {
|
|
|
4000
4000
|
(
|
|
4001
4001
|
name: string,
|
|
4002
4002
|
options?: {
|
|
4003
|
-
readonly attributes?: Record<string,
|
|
4003
|
+
readonly attributes?: Record<string, unknown>
|
|
4004
4004
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
4005
4005
|
readonly parent?: Tracer.ParentSpan
|
|
4006
4006
|
readonly root?: boolean
|
|
4007
|
+
readonly sampled?: boolean
|
|
4007
4008
|
readonly context?: Context.Context<never>
|
|
4008
4009
|
}
|
|
4009
4010
|
): <R, E, A>(self: Stream<R, E, A>) => Stream<R, E, A>
|
|
@@ -4011,10 +4012,11 @@ export const withSpan: {
|
|
|
4011
4012
|
self: Stream<R, E, A>,
|
|
4012
4013
|
name: string,
|
|
4013
4014
|
options?: {
|
|
4014
|
-
readonly attributes?: Record<string,
|
|
4015
|
+
readonly attributes?: Record<string, unknown>
|
|
4015
4016
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
4016
4017
|
readonly parent?: Tracer.ParentSpan
|
|
4017
4018
|
readonly root?: boolean
|
|
4019
|
+
readonly sampled?: boolean
|
|
4018
4020
|
readonly context?: Context.Context<never>
|
|
4019
4021
|
}
|
|
4020
4022
|
): Stream<R, E, A>
|
package/src/Tracer.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface Tracer {
|
|
|
29
29
|
parent: Option.Option<ParentSpan>,
|
|
30
30
|
context: Context.Context<never>,
|
|
31
31
|
links: ReadonlyArray<SpanLink>,
|
|
32
|
+
sampled: boolean,
|
|
32
33
|
startTime: bigint
|
|
33
34
|
) => Span
|
|
34
35
|
readonly context: <X>(f: () => X, fiber: Fiber.RuntimeFiber<any, any>) => X
|
|
@@ -62,6 +63,7 @@ export interface ExternalSpan {
|
|
|
62
63
|
readonly _tag: "ExternalSpan"
|
|
63
64
|
readonly spanId: string
|
|
64
65
|
readonly traceId: string
|
|
66
|
+
readonly sampled: boolean
|
|
65
67
|
readonly context: Context.Context<never>
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -77,17 +79,13 @@ export interface Span {
|
|
|
77
79
|
readonly parent: Option.Option<ParentSpan>
|
|
78
80
|
readonly context: Context.Context<never>
|
|
79
81
|
readonly status: SpanStatus
|
|
80
|
-
readonly attributes: ReadonlyMap<string,
|
|
82
|
+
readonly attributes: ReadonlyMap<string, unknown>
|
|
81
83
|
readonly links: ReadonlyArray<SpanLink>
|
|
84
|
+
readonly sampled: boolean
|
|
82
85
|
readonly end: (endTime: bigint, exit: Exit.Exit<unknown, unknown>) => void
|
|
83
|
-
readonly attribute: (key: string, value:
|
|
84
|
-
readonly event: (name: string, startTime: bigint, attributes?: Record<string,
|
|
86
|
+
readonly attribute: (key: string, value: unknown) => void
|
|
87
|
+
readonly event: (name: string, startTime: bigint, attributes?: Record<string, unknown>) => void
|
|
85
88
|
}
|
|
86
|
-
/**
|
|
87
|
-
* @since 2.0.0
|
|
88
|
-
* @category models
|
|
89
|
-
*/
|
|
90
|
-
export type AttributeValue = string | boolean | number
|
|
91
89
|
|
|
92
90
|
/**
|
|
93
91
|
* @since 2.0.0
|
|
@@ -96,7 +94,7 @@ export type AttributeValue = string | boolean | number
|
|
|
96
94
|
export interface SpanLink {
|
|
97
95
|
readonly _tag: "SpanLink"
|
|
98
96
|
readonly span: ParentSpan
|
|
99
|
-
readonly attributes: Readonly<Record<string,
|
|
97
|
+
readonly attributes: Readonly<Record<string, unknown>>
|
|
100
98
|
}
|
|
101
99
|
|
|
102
100
|
/**
|
|
@@ -111,6 +109,17 @@ export const Tracer: Context.Tag<Tracer, Tracer> = internal.tracerTag
|
|
|
111
109
|
*/
|
|
112
110
|
export const make: (options: Omit<Tracer, typeof TracerTypeId>) => Tracer = internal.make
|
|
113
111
|
|
|
112
|
+
/**
|
|
113
|
+
* @since 2.0.0
|
|
114
|
+
* @category constructors
|
|
115
|
+
*/
|
|
116
|
+
export const externalSpan: (options: {
|
|
117
|
+
readonly spanId: string
|
|
118
|
+
readonly traceId: string
|
|
119
|
+
readonly sampled?: boolean | undefined
|
|
120
|
+
readonly context?: Context.Context<never> | undefined
|
|
121
|
+
}) => ExternalSpan = internal.externalSpan
|
|
122
|
+
|
|
114
123
|
/**
|
|
115
124
|
* @since 2.0.0
|
|
116
125
|
* @category constructors
|
package/src/index.ts
CHANGED
|
@@ -36,7 +36,7 @@ export {
|
|
|
36
36
|
*
|
|
37
37
|
* @since 2.0.0
|
|
38
38
|
*/
|
|
39
|
-
export * as
|
|
39
|
+
export * as BigInt from "effect/BigInt"
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* This module provides utility functions and type class instances for working with the `boolean` type in TypeScript.
|
|
@@ -388,6 +388,11 @@ export * as LogSpan from "effect/LogSpan"
|
|
|
388
388
|
*/
|
|
389
389
|
export * as Logger from "effect/Logger"
|
|
390
390
|
|
|
391
|
+
/**
|
|
392
|
+
* @since 1.0.0
|
|
393
|
+
*/
|
|
394
|
+
export * as Match from "effect/Match"
|
|
395
|
+
|
|
391
396
|
/**
|
|
392
397
|
* @since 2.0.0
|
|
393
398
|
*/
|
package/src/internal/channel.ts
CHANGED
|
@@ -2302,10 +2302,11 @@ export const withSpan = dual<
|
|
|
2302
2302
|
(
|
|
2303
2303
|
name: string,
|
|
2304
2304
|
options?: {
|
|
2305
|
-
readonly attributes?: Record<string,
|
|
2305
|
+
readonly attributes?: Record<string, unknown>
|
|
2306
2306
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
2307
2307
|
readonly parent?: Tracer.ParentSpan
|
|
2308
2308
|
readonly root?: boolean
|
|
2309
|
+
readonly sampled?: boolean
|
|
2309
2310
|
readonly context?: Context.Context<never>
|
|
2310
2311
|
}
|
|
2311
2312
|
) => <Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>(
|
|
@@ -2315,14 +2316,15 @@ export const withSpan = dual<
|
|
|
2315
2316
|
self: Channel.Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>,
|
|
2316
2317
|
name: string,
|
|
2317
2318
|
options?: {
|
|
2318
|
-
readonly attributes?: Record<string,
|
|
2319
|
+
readonly attributes?: Record<string, unknown>
|
|
2319
2320
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
2320
2321
|
readonly parent?: Tracer.ParentSpan
|
|
2321
2322
|
readonly root?: boolean
|
|
2323
|
+
readonly sampled?: boolean
|
|
2322
2324
|
readonly context?: Context.Context<never>
|
|
2323
2325
|
}
|
|
2324
2326
|
) => Channel.Channel<Env, InErr, InElem, InDone, OutErr, OutElem, OutDone>
|
|
2325
|
-
>(3, (self, name, options) => unwrapScoped(Effect.as(Effect.
|
|
2327
|
+
>(3, (self, name, options) => unwrapScoped(Effect.as(Effect.setSpan(name, options), self)))
|
|
2326
2328
|
|
|
2327
2329
|
/** @internal */
|
|
2328
2330
|
export const writeAll = <OutElem>(
|
|
@@ -22,7 +22,6 @@ import * as metricLabel from "../internal/metric/label"
|
|
|
22
22
|
import * as runtimeFlags from "../internal/runtimeFlags"
|
|
23
23
|
import * as SingleShotGen from "../internal/singleShotGen"
|
|
24
24
|
import * as List from "../List"
|
|
25
|
-
import type * as Logger from "../Logger"
|
|
26
25
|
import * as LogLevel from "../LogLevel"
|
|
27
26
|
import * as LogSpan from "../LogSpan"
|
|
28
27
|
import type * as Metric from "../Metric"
|
|
@@ -38,14 +37,14 @@ import * as Tracer from "../Tracer"
|
|
|
38
37
|
/* @internal */
|
|
39
38
|
export const annotateLogs = dual<
|
|
40
39
|
{
|
|
41
|
-
(key: string, value:
|
|
40
|
+
(key: string, value: unknown): <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R, E, A>
|
|
42
41
|
(
|
|
43
|
-
values: Record<string,
|
|
42
|
+
values: Record<string, unknown>
|
|
44
43
|
): <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R, E, A>
|
|
45
44
|
},
|
|
46
45
|
{
|
|
47
|
-
<R, E, A>(effect: Effect.Effect<R, E, A>, key: string, value:
|
|
48
|
-
<R, E, A>(effect: Effect.Effect<R, E, A>, values: Record<string,
|
|
46
|
+
<R, E, A>(effect: Effect.Effect<R, E, A>, key: string, value: unknown): Effect.Effect<R, E, A>
|
|
47
|
+
<R, E, A>(effect: Effect.Effect<R, E, A>, values: Record<string, unknown>): Effect.Effect<R, E, A>
|
|
49
48
|
}
|
|
50
49
|
>(
|
|
51
50
|
(args) => core.isEffect(args[0]),
|
|
@@ -57,7 +56,7 @@ export const annotateLogs = dual<
|
|
|
57
56
|
typeof args[1] === "string"
|
|
58
57
|
? HashMap.set(args[1], args[2])
|
|
59
58
|
: (annotations) =>
|
|
60
|
-
Object.entries(args[1] as Record<string,
|
|
59
|
+
Object.entries(args[1] as Record<string, unknown>).reduce(
|
|
61
60
|
(acc, [key, value]) => HashMap.set(acc, key, value),
|
|
62
61
|
annotations
|
|
63
62
|
)
|
|
@@ -942,7 +941,7 @@ export const withLogSpan = dual<
|
|
|
942
941
|
)))
|
|
943
942
|
|
|
944
943
|
/* @internal */
|
|
945
|
-
export const logAnnotations: Effect.Effect<never, never, HashMap.HashMap<string,
|
|
944
|
+
export const logAnnotations: Effect.Effect<never, never, HashMap.HashMap<string, unknown>> = core
|
|
946
945
|
.fiberRefGet(
|
|
947
946
|
core.currentLogAnnotations
|
|
948
947
|
)
|
|
@@ -1897,8 +1896,8 @@ export const serviceMembers = <I, S>(tag: Context.Tag<I, S>): {
|
|
|
1897
1896
|
|
|
1898
1897
|
/* @internal */
|
|
1899
1898
|
export const annotateCurrentSpan: {
|
|
1900
|
-
(key: string, value:
|
|
1901
|
-
(values: Record<string,
|
|
1899
|
+
(key: string, value: unknown): Effect.Effect<never, never, void>
|
|
1900
|
+
(values: Record<string, unknown>): Effect.Effect<never, never, void>
|
|
1902
1901
|
} = function(): Effect.Effect<never, never, void> {
|
|
1903
1902
|
const args = arguments
|
|
1904
1903
|
return core.flatMap(
|
|
@@ -1921,14 +1920,14 @@ export const annotateCurrentSpan: {
|
|
|
1921
1920
|
/* @internal */
|
|
1922
1921
|
export const annotateSpans = dual<
|
|
1923
1922
|
{
|
|
1924
|
-
(key: string, value:
|
|
1923
|
+
(key: string, value: unknown): <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R, E, A>
|
|
1925
1924
|
(
|
|
1926
|
-
values: Record<string,
|
|
1925
|
+
values: Record<string, unknown>
|
|
1927
1926
|
): <R, E, A>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R, E, A>
|
|
1928
1927
|
},
|
|
1929
1928
|
{
|
|
1930
|
-
<R, E, A>(effect: Effect.Effect<R, E, A>, key: string, value:
|
|
1931
|
-
<R, E, A>(effect: Effect.Effect<R, E, A>, values: Record<string,
|
|
1929
|
+
<R, E, A>(effect: Effect.Effect<R, E, A>, key: string, value: unknown): Effect.Effect<R, E, A>
|
|
1930
|
+
<R, E, A>(effect: Effect.Effect<R, E, A>, values: Record<string, unknown>): Effect.Effect<R, E, A>
|
|
1932
1931
|
}
|
|
1933
1932
|
>(
|
|
1934
1933
|
(args) => core.isEffect(args[0]),
|
|
@@ -1940,7 +1939,7 @@ export const annotateSpans = dual<
|
|
|
1940
1939
|
typeof args[1] === "string"
|
|
1941
1940
|
? HashMap.set(args[1], args[2])
|
|
1942
1941
|
: (annotations) =>
|
|
1943
|
-
Object.entries(args[1] as Record<string,
|
|
1942
|
+
Object.entries(args[1] as Record<string, unknown>).reduce(
|
|
1944
1943
|
(acc, [key, value]) => HashMap.set(acc, key, value),
|
|
1945
1944
|
annotations
|
|
1946
1945
|
)
|
|
@@ -1971,12 +1970,12 @@ export const currentTimeNanosTracing = core.fiberRefGetWith(
|
|
|
1971
1970
|
export const linkSpans = dual<
|
|
1972
1971
|
(
|
|
1973
1972
|
span: Tracer.ParentSpan,
|
|
1974
|
-
attributes?: Record<string,
|
|
1973
|
+
attributes?: Record<string, unknown>
|
|
1975
1974
|
) => <R, E, A>(self: Effect.Effect<R, E, A>) => Effect.Effect<R, E, A>,
|
|
1976
1975
|
<R, E, A>(
|
|
1977
1976
|
self: Effect.Effect<R, E, A>,
|
|
1978
1977
|
span: Tracer.ParentSpan,
|
|
1979
|
-
attributes?: Record<string,
|
|
1978
|
+
attributes?: Record<string, unknown>
|
|
1980
1979
|
) => Effect.Effect<R, E, A>
|
|
1981
1980
|
>(
|
|
1982
1981
|
(args) => core.isEffect(args[0]),
|
|
@@ -1998,10 +1997,11 @@ export const linkSpans = dual<
|
|
|
1998
1997
|
export const makeSpan = (
|
|
1999
1998
|
name: string,
|
|
2000
1999
|
options?: {
|
|
2001
|
-
readonly attributes?: Record<string,
|
|
2000
|
+
readonly attributes?: Record<string, unknown>
|
|
2002
2001
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
2003
2002
|
readonly parent?: Tracer.ParentSpan
|
|
2004
2003
|
readonly root?: boolean
|
|
2004
|
+
readonly sampled?: boolean
|
|
2005
2005
|
readonly context?: Context.Context<never>
|
|
2006
2006
|
}
|
|
2007
2007
|
) =>
|
|
@@ -2031,6 +2031,7 @@ export const makeSpan = (
|
|
|
2031
2031
|
parent,
|
|
2032
2032
|
options?.context ?? Context.empty(),
|
|
2033
2033
|
linksArray,
|
|
2034
|
+
options?.sampled ?? (parent._tag === "Some" ? parent.value.sampled : true),
|
|
2034
2035
|
startTime
|
|
2035
2036
|
)
|
|
2036
2037
|
HashMap.forEach(annotations, (value, key) => span.attribute(key, value))
|
|
@@ -2044,7 +2045,7 @@ export const makeSpan = (
|
|
|
2044
2045
|
)
|
|
2045
2046
|
|
|
2046
2047
|
/* @internal */
|
|
2047
|
-
export const spanAnnotations: Effect.Effect<never, never, HashMap.HashMap<string,
|
|
2048
|
+
export const spanAnnotations: Effect.Effect<never, never, HashMap.HashMap<string, unknown>> = core
|
|
2048
2049
|
.fiberRefGet(core.currentTracerSpanAnnotations)
|
|
2049
2050
|
|
|
2050
2051
|
/* @internal */
|
|
@@ -2055,10 +2056,11 @@ export const spanLinks: Effect.Effect<never, never, Chunk.Chunk<Tracer.SpanLink>
|
|
|
2055
2056
|
export const useSpan: {
|
|
2056
2057
|
<R, E, A>(name: string, evaluate: (span: Tracer.Span) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A>
|
|
2057
2058
|
<R, E, A>(name: string, options: {
|
|
2058
|
-
readonly attributes?: Record<string,
|
|
2059
|
+
readonly attributes?: Record<string, unknown>
|
|
2059
2060
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
2060
2061
|
readonly parent?: Tracer.ParentSpan
|
|
2061
2062
|
readonly root?: boolean
|
|
2063
|
+
readonly sampled?: boolean
|
|
2062
2064
|
readonly context?: Context.Context<never>
|
|
2063
2065
|
}, evaluate: (span: Tracer.Span) => Effect.Effect<R, E, A>): Effect.Effect<R, E, A>
|
|
2064
2066
|
} = <R, E, A>(
|
|
@@ -2069,10 +2071,11 @@ export const useSpan: {
|
|
|
2069
2071
|
]
|
|
2070
2072
|
) => {
|
|
2071
2073
|
const options: {
|
|
2072
|
-
readonly attributes?: Record<string,
|
|
2074
|
+
readonly attributes?: Record<string, unknown>
|
|
2073
2075
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
2074
2076
|
readonly parent?: Tracer.ParentSpan
|
|
2075
2077
|
readonly root?: boolean
|
|
2078
|
+
readonly sampled?: boolean
|
|
2076
2079
|
readonly context?: Context.Context<never>
|
|
2077
2080
|
} | undefined = args.length === 1 ? undefined : args[0]
|
|
2078
2081
|
const evaluate: (span: Tracer.Span) => Effect.Effect<R, E, A> = args[args.length - 1]
|
|
@@ -2102,17 +2105,19 @@ export const withParentSpan = dual<
|
|
|
2102
2105
|
/** @internal */
|
|
2103
2106
|
export const withSpan = dual<
|
|
2104
2107
|
(name: string, options?: {
|
|
2105
|
-
readonly attributes?: Record<string,
|
|
2108
|
+
readonly attributes?: Record<string, unknown>
|
|
2106
2109
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
2107
2110
|
readonly parent?: Tracer.ParentSpan
|
|
2108
2111
|
readonly root?: boolean
|
|
2112
|
+
readonly sampled?: boolean
|
|
2109
2113
|
readonly context?: Context.Context<never>
|
|
2110
2114
|
}) => <R, E, A>(self: Effect.Effect<R, E, A>) => Effect.Effect<R, E, A>,
|
|
2111
2115
|
<R, E, A>(self: Effect.Effect<R, E, A>, name: string, options?: {
|
|
2112
|
-
readonly attributes?: Record<string,
|
|
2116
|
+
readonly attributes?: Record<string, unknown>
|
|
2113
2117
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
2114
2118
|
readonly parent?: Tracer.ParentSpan
|
|
2115
2119
|
readonly root?: boolean
|
|
2120
|
+
readonly sampled?: boolean
|
|
2116
2121
|
readonly context?: Context.Context<never>
|
|
2117
2122
|
}) => Effect.Effect<R, E, A>
|
|
2118
2123
|
>(
|
package/src/internal/core.ts
CHANGED
|
@@ -28,7 +28,6 @@ import * as DeferredOpCodes from "../internal/opCodes/deferred"
|
|
|
28
28
|
import * as OpCodes from "../internal/opCodes/effect"
|
|
29
29
|
import * as _runtimeFlags from "../internal/runtimeFlags"
|
|
30
30
|
import * as List from "../List"
|
|
31
|
-
import type * as Logger from "../Logger"
|
|
32
31
|
import type * as LogLevel from "../LogLevel"
|
|
33
32
|
import type * as LogSpan from "../LogSpan"
|
|
34
33
|
import type * as MetricLabel from "../MetricLabel"
|
|
@@ -1846,7 +1845,7 @@ export const currentMaxOpsBeforeYield: FiberRef.FiberRef<number> = globalValue(
|
|
|
1846
1845
|
)
|
|
1847
1846
|
|
|
1848
1847
|
/** @internal */
|
|
1849
|
-
export const currentLogAnnotations: FiberRef.FiberRef<HashMap.HashMap<string,
|
|
1848
|
+
export const currentLogAnnotations: FiberRef.FiberRef<HashMap.HashMap<string, unknown>> = globalValue(
|
|
1850
1849
|
Symbol.for("effect/FiberRef/currentLogAnnotation"),
|
|
1851
1850
|
() => fiberRefUnsafeMake(HashMap.empty())
|
|
1852
1851
|
)
|
|
@@ -1945,11 +1944,10 @@ export const currentTracerTimingEnabled: FiberRef.FiberRef<boolean> = globalValu
|
|
|
1945
1944
|
)
|
|
1946
1945
|
|
|
1947
1946
|
/** @internal */
|
|
1948
|
-
export const currentTracerSpanAnnotations: FiberRef.FiberRef<HashMap.HashMap<string,
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
)
|
|
1947
|
+
export const currentTracerSpanAnnotations: FiberRef.FiberRef<HashMap.HashMap<string, unknown>> = globalValue(
|
|
1948
|
+
Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),
|
|
1949
|
+
() => fiberRefUnsafeMake(HashMap.empty())
|
|
1950
|
+
)
|
|
1953
1951
|
|
|
1954
1952
|
/** @internal */
|
|
1955
1953
|
export const currentTracerSpanLinks: FiberRef.FiberRef<Chunk.Chunk<Tracer.SpanLink>> = globalValue(
|
|
@@ -17,6 +17,7 @@ import * as FiberRefsPatch from "../FiberRefsPatch"
|
|
|
17
17
|
import * as FiberStatus from "../FiberStatus"
|
|
18
18
|
import type { LazyArg } from "../Function"
|
|
19
19
|
import { dual, identity, pipe } from "../Function"
|
|
20
|
+
import * as HashMap from "../HashMap"
|
|
20
21
|
import * as HashSet from "../HashSet"
|
|
21
22
|
import * as _RequestBlock from "../internal/blockedRequests"
|
|
22
23
|
import * as internalCause from "../internal/cause"
|
|
@@ -1382,7 +1383,7 @@ export const tracerLogger = internalLogger.makeLogger<unknown, void>(({
|
|
|
1382
1383
|
return
|
|
1383
1384
|
}
|
|
1384
1385
|
|
|
1385
|
-
const attributes = Object.fromEntries(annotations)
|
|
1386
|
+
const attributes = Object.fromEntries(HashMap.map(annotations, (value) => internalLogger.serializeUnknown(value)))
|
|
1386
1387
|
attributes["effect.fiberId"] = FiberId.threadName(fiberId)
|
|
1387
1388
|
attributes["effect.logLevel"] = logLevel.label
|
|
1388
1389
|
|
|
@@ -3429,13 +3430,14 @@ export const interruptWhenPossible = dual<
|
|
|
3429
3430
|
// circular Tracer
|
|
3430
3431
|
|
|
3431
3432
|
/** @internal */
|
|
3432
|
-
export const
|
|
3433
|
+
export const makeSpanScoped = (
|
|
3433
3434
|
name: string,
|
|
3434
3435
|
options?: {
|
|
3435
|
-
readonly attributes?: Record<string,
|
|
3436
|
+
readonly attributes?: Record<string, unknown>
|
|
3436
3437
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
3437
3438
|
readonly parent?: Tracer.ParentSpan
|
|
3438
3439
|
readonly root?: boolean
|
|
3440
|
+
readonly sampled?: boolean
|
|
3439
3441
|
readonly context?: Context.Context<never>
|
|
3440
3442
|
}
|
|
3441
3443
|
): Effect.Effect<Scope.Scope, never, Tracer.Span> =>
|
|
@@ -3449,23 +3451,20 @@ export const useSpanScoped = (
|
|
|
3449
3451
|
)
|
|
3450
3452
|
|
|
3451
3453
|
/* @internal */
|
|
3452
|
-
export const
|
|
3454
|
+
export const setSpan = (
|
|
3453
3455
|
name: string,
|
|
3454
3456
|
options?: {
|
|
3455
|
-
readonly attributes?: Record<string,
|
|
3457
|
+
readonly attributes?: Record<string, unknown>
|
|
3456
3458
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
3457
3459
|
readonly parent?: Tracer.ParentSpan
|
|
3458
3460
|
readonly root?: boolean
|
|
3461
|
+
readonly sampled?: boolean
|
|
3459
3462
|
readonly context?: Context.Context<never>
|
|
3460
3463
|
}
|
|
3461
3464
|
): Effect.Effect<Scope.Scope, never, void> =>
|
|
3462
|
-
core.
|
|
3463
|
-
|
|
3464
|
-
(span) =>
|
|
3465
|
-
fiberRefLocallyScopedWith(
|
|
3466
|
-
core.currentTracerSpan,
|
|
3467
|
-
List.prepend(span)
|
|
3468
|
-
)
|
|
3465
|
+
core.tap(
|
|
3466
|
+
makeSpanScoped(name, options),
|
|
3467
|
+
(span) => setParentSpan(span)
|
|
3469
3468
|
)
|
|
3470
3469
|
|
|
3471
3470
|
/* @internal */
|
|
@@ -3473,5 +3472,32 @@ export const withTracerScoped = (value: Tracer.Tracer): Effect.Effect<Scope.Scop
|
|
|
3473
3472
|
fiberRefLocallyScopedWith(defaultServices.currentServices, Context.add(tracer.tracerTag, value))
|
|
3474
3473
|
|
|
3475
3474
|
/* @internal */
|
|
3476
|
-
export const
|
|
3475
|
+
export const setParentSpan = (span: Tracer.ParentSpan): Effect.Effect<Scope.Scope, never, void> =>
|
|
3477
3476
|
fiberRefLocallyScopedWith(core.currentTracerSpan, List.prepend(span))
|
|
3477
|
+
|
|
3478
|
+
/** @internal */
|
|
3479
|
+
export const withSpanScoped = dual<
|
|
3480
|
+
(name: string, options?: {
|
|
3481
|
+
readonly attributes?: Record<string, unknown>
|
|
3482
|
+
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
3483
|
+
readonly parent?: Tracer.ParentSpan
|
|
3484
|
+
readonly root?: boolean
|
|
3485
|
+
readonly sampled?: boolean
|
|
3486
|
+
readonly context?: Context.Context<never>
|
|
3487
|
+
}) => <R, E, A>(self: Effect.Effect<R, E, A>) => Effect.Effect<R | Scope.Scope, E, A>,
|
|
3488
|
+
<R, E, A>(self: Effect.Effect<R, E, A>, name: string, options?: {
|
|
3489
|
+
readonly attributes?: Record<string, unknown>
|
|
3490
|
+
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
3491
|
+
readonly parent?: Tracer.ParentSpan
|
|
3492
|
+
readonly root?: boolean
|
|
3493
|
+
readonly sampled?: boolean
|
|
3494
|
+
readonly context?: Context.Context<never>
|
|
3495
|
+
}) => Effect.Effect<R | Scope.Scope, E, A>
|
|
3496
|
+
>(
|
|
3497
|
+
(args) => typeof args[0] !== "string",
|
|
3498
|
+
(self, name, options) =>
|
|
3499
|
+
core.flatMap(
|
|
3500
|
+
makeSpanScoped(name, options),
|
|
3501
|
+
(span) => core.fiberRefLocallyWith(self, core.currentTracerSpan, List.prepend(span))
|
|
3502
|
+
)
|
|
3503
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as ConfigProvider from "../../ConfigProvider"
|
|
2
2
|
import type * as Context from "../../Context"
|
|
3
3
|
import type * as Effect from "../../Effect"
|
|
4
|
+
import type * as Exit from "../../Exit"
|
|
4
5
|
import { dual } from "../../Function"
|
|
5
6
|
import * as HashSet from "../../HashSet"
|
|
6
7
|
import * as core from "../../internal/core"
|
|
@@ -9,7 +10,7 @@ import * as layer from "../../internal/layer"
|
|
|
9
10
|
import * as runtimeFlags from "../../internal/runtimeFlags"
|
|
10
11
|
import * as runtimeFlagsPatch from "../../internal/runtimeFlagsPatch"
|
|
11
12
|
import * as _supervisor from "../../internal/supervisor"
|
|
12
|
-
import * as Layer from "../../Layer"
|
|
13
|
+
import type * as Layer from "../../Layer"
|
|
13
14
|
import type * as Logger from "../../Logger"
|
|
14
15
|
import type * as LogLevel from "../../LogLevel"
|
|
15
16
|
import type { Scope } from "../../Scope"
|
|
@@ -50,7 +51,7 @@ export const addLogger = <A>(logger: Logger.Logger<unknown, A>): Layer.Layer<nev
|
|
|
50
51
|
export const addLoggerEffect = <R, E, A>(
|
|
51
52
|
effect: Effect.Effect<R, E, Logger.Logger<unknown, A>>
|
|
52
53
|
): Layer.Layer<R, E, never> =>
|
|
53
|
-
|
|
54
|
+
layer.unwrapEffect(
|
|
54
55
|
core.map(effect, addLogger)
|
|
55
56
|
)
|
|
56
57
|
|
|
@@ -58,7 +59,7 @@ export const addLoggerEffect = <R, E, A>(
|
|
|
58
59
|
export const addLoggerScoped = <R, E, A>(
|
|
59
60
|
effect: Effect.Effect<R, E, Logger.Logger<unknown, A>>
|
|
60
61
|
): Layer.Layer<Exclude<R, Scope>, E, never> =>
|
|
61
|
-
|
|
62
|
+
layer.unwrapScoped(
|
|
62
63
|
core.map(effect, addLogger)
|
|
63
64
|
)
|
|
64
65
|
|
|
@@ -184,19 +185,33 @@ export const setConfigProvider = (configProvider: ConfigProvider.ConfigProvider)
|
|
|
184
185
|
|
|
185
186
|
/** @internal */
|
|
186
187
|
export const setParentSpan = (span: Tracer.ParentSpan): Layer.Layer<never, never, never> =>
|
|
187
|
-
layer.scopedDiscard(fiberRuntime.
|
|
188
|
+
layer.scopedDiscard(fiberRuntime.setParentSpan(span))
|
|
188
189
|
|
|
189
190
|
/** @internal */
|
|
190
191
|
export const setSpan = (
|
|
191
192
|
name: string,
|
|
192
193
|
options?: {
|
|
193
|
-
readonly attributes?: Record<string,
|
|
194
|
+
readonly attributes?: Record<string, unknown>
|
|
194
195
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
195
196
|
readonly parent?: Tracer.ParentSpan
|
|
196
197
|
readonly root?: boolean
|
|
198
|
+
readonly sampled?: boolean
|
|
197
199
|
readonly context?: Context.Context<never>
|
|
200
|
+
readonly onEnd?: (span: Tracer.Span, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<never, never, void>
|
|
198
201
|
}
|
|
199
|
-
): Layer.Layer<never, never, never> =>
|
|
202
|
+
): Layer.Layer<never, never, never> =>
|
|
203
|
+
layer.scopedDiscard(
|
|
204
|
+
options?.onEnd
|
|
205
|
+
? core.tap(
|
|
206
|
+
fiberRuntime.makeSpanScoped(name, options),
|
|
207
|
+
(span) =>
|
|
208
|
+
core.zipRight(
|
|
209
|
+
fiberRuntime.addFinalizer((exit) => options.onEnd!(span, exit)),
|
|
210
|
+
fiberRuntime.setParentSpan(span)
|
|
211
|
+
)
|
|
212
|
+
)
|
|
213
|
+
: fiberRuntime.setSpan(name, options)
|
|
214
|
+
)
|
|
200
215
|
|
|
201
216
|
/** @internal */
|
|
202
217
|
export const setTracer = (tracer: Tracer.Tracer): Layer.Layer<never, never, never> =>
|
package/src/internal/layer.ts
CHANGED
|
@@ -18,6 +18,7 @@ import * as ref from "../internal/ref"
|
|
|
18
18
|
import * as runtime from "../internal/runtime"
|
|
19
19
|
import * as synchronized from "../internal/synchronizedRef"
|
|
20
20
|
import type * as Layer from "../Layer"
|
|
21
|
+
import * as List from "../List"
|
|
21
22
|
import { pipeArguments } from "../Pipeable"
|
|
22
23
|
import type * as Runtime from "../Runtime"
|
|
23
24
|
import type * as Schedule from "../Schedule"
|
|
@@ -1122,27 +1123,42 @@ export const unwrapScoped = <R, E, R1, E1, A>(
|
|
|
1122
1123
|
/** @internal */
|
|
1123
1124
|
export const withSpan = dual<
|
|
1124
1125
|
(name: string, options?: {
|
|
1125
|
-
readonly attributes?: Record<string,
|
|
1126
|
+
readonly attributes?: Record<string, unknown>
|
|
1126
1127
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
1127
1128
|
readonly parent?: Tracer.ParentSpan
|
|
1128
1129
|
readonly root?: boolean
|
|
1130
|
+
readonly sampled?: boolean
|
|
1129
1131
|
readonly context?: Context.Context<never>
|
|
1132
|
+
readonly onEnd?: (span: Tracer.Span, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<never, never, void>
|
|
1130
1133
|
}) => <R, E, A>(self: Layer.Layer<R, E, A>) => Layer.Layer<R, E, A>,
|
|
1131
1134
|
<R, E, A>(self: Layer.Layer<R, E, A>, name: string, options?: {
|
|
1132
|
-
readonly attributes?: Record<string,
|
|
1135
|
+
readonly attributes?: Record<string, unknown>
|
|
1133
1136
|
readonly links?: ReadonlyArray<Tracer.SpanLink>
|
|
1134
1137
|
readonly parent?: Tracer.ParentSpan
|
|
1135
1138
|
readonly root?: boolean
|
|
1139
|
+
readonly sampled?: boolean
|
|
1136
1140
|
readonly context?: Context.Context<never>
|
|
1141
|
+
readonly onEnd?: (span: Tracer.Span, exit: Exit.Exit<unknown, unknown>) => Effect.Effect<never, never, void>
|
|
1137
1142
|
}) => Layer.Layer<R, E, A>
|
|
1138
1143
|
>((args) => isLayer(args[0]), (self, name, options) =>
|
|
1139
1144
|
unwrapScoped(
|
|
1140
1145
|
core.map(
|
|
1141
|
-
|
|
1142
|
-
|
|
1146
|
+
options?.onEnd
|
|
1147
|
+
? core.tap(
|
|
1148
|
+
fiberRuntime.makeSpanScoped(name, options),
|
|
1149
|
+
(span) => fiberRuntime.addFinalizer((exit) => options.onEnd!(span, exit))
|
|
1150
|
+
)
|
|
1151
|
+
: fiberRuntime.makeSpanScoped(name, options),
|
|
1152
|
+
(span) => withParentSpan(self, span)
|
|
1143
1153
|
)
|
|
1144
1154
|
))
|
|
1145
1155
|
|
|
1156
|
+
/** @internal */
|
|
1157
|
+
export const withParentSpan = dual<
|
|
1158
|
+
(span: Tracer.ParentSpan) => <R, E, A>(self: Layer.Layer<R, E, A>) => Layer.Layer<R, E, A>,
|
|
1159
|
+
<R, E, A>(self: Layer.Layer<R, E, A>, span: Tracer.ParentSpan) => Layer.Layer<R, E, A>
|
|
1160
|
+
>(2, (self, span) => fiberRefLocallyWith(self, core.currentTracerSpan, List.prepend(span)))
|
|
1161
|
+
|
|
1146
1162
|
// circular with Effect
|
|
1147
1163
|
|
|
1148
1164
|
const provideSomeLayer = dual<
|
package/src/internal/logger.ts
CHANGED
|
@@ -37,7 +37,7 @@ export const makeLogger = <Message, Output>(
|
|
|
37
37
|
readonly cause: CauseExt.Cause<unknown>
|
|
38
38
|
readonly context: FiberRefs.FiberRefs
|
|
39
39
|
readonly spans: List.List<LogSpan.LogSpan>
|
|
40
|
-
readonly annotations: HashMap.HashMap<string,
|
|
40
|
+
readonly annotations: HashMap.HashMap<string, unknown>
|
|
41
41
|
readonly date: Date
|
|
42
42
|
}
|
|
43
43
|
) => Output
|
|
@@ -207,7 +207,7 @@ export const stringLogger: Logger.Logger<unknown, string> = makeLogger<unknown,
|
|
|
207
207
|
}
|
|
208
208
|
output = output + filterKeyName(key)
|
|
209
209
|
output = output + "="
|
|
210
|
-
output = appendQuoted(
|
|
210
|
+
output = appendQuoted(serializeUnknown(value), output)
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|
|
@@ -215,7 +215,7 @@ export const stringLogger: Logger.Logger<unknown, string> = makeLogger<unknown,
|
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
217
|
|
|
218
|
-
const serializeUnknown = (u: unknown): string => {
|
|
218
|
+
export const serializeUnknown = (u: unknown): string => {
|
|
219
219
|
try {
|
|
220
220
|
return typeof u === "object" ? JSON.stringify(u) : String(u)
|
|
221
221
|
} catch (_) {
|
|
@@ -282,7 +282,7 @@ export const logfmtLogger = makeLogger<unknown, string>(
|
|
|
282
282
|
}
|
|
283
283
|
output = output + filterKeyName(key)
|
|
284
284
|
output = output + "="
|
|
285
|
-
output = appendQuotedLogfmt(
|
|
285
|
+
output = appendQuotedLogfmt(serializeUnknown(value), output)
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|