effect 4.0.0-beta.30 → 4.0.0-beta.32
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 +87 -86
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +47 -40
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +46 -45
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +35 -38
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +39 -32
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +32 -29
- package/dist/BigInt.js.map +1 -1
- package/dist/Channel.d.ts +2 -2
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js.map +1 -1
- package/dist/Chunk.d.ts +58 -57
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +20 -21
- package/dist/Chunk.js.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +4 -1
- package/dist/Config.js.map +1 -1
- package/dist/Cron.d.ts +3 -6
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +11 -18
- package/dist/Cron.js.map +1 -1
- package/dist/DateTime.d.ts +49 -92
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +9 -9
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +7 -5
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +7 -5
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +55 -25
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +100 -70
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +3 -4
- package/dist/Effect.js.map +1 -1
- package/dist/Fiber.d.ts +2 -1
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +9 -8
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +8 -7
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +20 -19
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +6 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FileSystem.d.ts +17 -16
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +10 -7
- package/dist/FileSystem.js.map +1 -1
- package/dist/Graph.d.ts +64 -64
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +53 -53
- package/dist/Graph.js.map +1 -1
- package/dist/HashMap.d.ts +11 -5
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +3 -1
- package/dist/HashMap.js.map +1 -1
- package/dist/Iterable.d.ts +11 -11
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +12 -12
- package/dist/Iterable.js.map +1 -1
- package/dist/Latch.d.ts +69 -3
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +58 -0
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +181 -2
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +35 -2
- package/dist/Layer.js.map +1 -1
- package/dist/Number.d.ts +74 -18
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +34 -15
- package/dist/Number.js.map +1 -1
- package/dist/Option.d.ts +2 -0
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +183 -0
- package/dist/PartitionedSemaphore.d.ts.map +1 -0
- package/dist/PartitionedSemaphore.js +231 -0
- package/dist/PartitionedSemaphore.js.map +1 -0
- package/dist/PubSub.d.ts +5 -4
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +6 -5
- package/dist/PubSub.js.map +1 -1
- package/dist/Queue.d.ts +3 -3
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +2 -2
- package/dist/Queue.js.map +1 -1
- package/dist/Record.d.ts +40 -40
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +16 -15
- package/dist/Record.js.map +1 -1
- package/dist/Scheduler.d.ts +25 -123
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +20 -123
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +2346 -114
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +1359 -68
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +2 -2
- package/dist/SchemaAST.js +2 -2
- package/dist/SchemaGetter.js +6 -4
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +2 -2
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +32 -27
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Semaphore.d.ts +149 -53
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +137 -117
- package/dist/Semaphore.js.map +1 -1
- package/dist/ServiceMap.d.ts +26 -0
- package/dist/ServiceMap.d.ts.map +1 -1
- package/dist/ServiceMap.js +36 -21
- package/dist/ServiceMap.js.map +1 -1
- package/dist/Stream.js +1 -1
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +114 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +29 -47
- package/dist/String.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +1 -2
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +81 -115
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Terminal.d.ts +2 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +5 -4
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +2 -1
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +26 -14
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +8 -4
- package/dist/Trie.js.map +1 -1
- package/dist/TxHashMap.d.ts +77 -59
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +25 -19
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxSemaphore.d.ts +162 -2
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +16 -2
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/index.d.ts +88 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -32
- package/dist/index.js.map +1 -1
- package/dist/internal/dateTime.js +66 -59
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +21 -90
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +2 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/option.js +6 -0
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/trie.js +3 -3
- package/dist/internal/trie.js.map +1 -1
- package/dist/unstable/ai/AiError.js +1 -1
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +4 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +3 -4
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +2 -2
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +30 -16
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +10 -87
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +4 -0
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +14 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +13 -0
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -4
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -3
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +3 -2
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +4 -3
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +3 -2
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +3 -3
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +16 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -0
- package/dist/unstable/cli/Completions.js +23 -0
- package/dist/unstable/cli/Completions.js.map +1 -0
- package/dist/unstable/cli/Flag.d.ts +2 -2
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +4 -4
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +14 -12
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +4 -4
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +7 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.js +71 -67
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +4 -0
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +4 -0
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js +9 -2
- package/dist/unstable/cli/internal/completions/CommandDescriptor.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +8 -3
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +3 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +25 -23
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +3 -2
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +7 -7
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +4 -3
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +3 -2
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +10 -10
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +12 -12
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +2 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -3
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +9 -8
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +2 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +7 -6
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +19 -13
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +5 -4
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +4 -4
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +19 -18
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +9 -10
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +2 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +1 -4
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +8 -8
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +5 -4
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +3 -4
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +5 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +3 -2
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +2 -1
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +2 -1
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +4 -3
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +8 -6
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +2 -1
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +3 -2
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +16 -15
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +3 -2
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +2 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +7 -7
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +2 -2
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +2 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +2 -1
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +3 -2
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +14 -10
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +4 -3
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +3 -2
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +27 -15
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +5 -4
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +5 -6
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +4 -2
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +15 -0
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +81 -3
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -2
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +7 -3
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/Persistable.js +1 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +1 -5
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +4 -2
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -3
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +4 -4
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +1 -3
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +3 -2
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +4 -1
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +3 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +2 -1
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +1 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +6 -6
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +2 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +5 -4
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +19 -14
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +112 -105
- package/src/BigDecimal.ts +63 -66
- package/src/BigInt.ts +49 -41
- package/src/Channel.ts +3 -3
- package/src/Chunk.ts +68 -63
- package/src/Config.ts +4 -1
- package/src/Cron.ts +13 -18
- package/src/DateTime.ts +51 -92
- package/src/Deferred.ts +8 -6
- package/src/Duration.ts +112 -56
- package/src/Effect.ts +3 -4
- package/src/Fiber.ts +2 -1
- package/src/FiberHandle.ts +10 -9
- package/src/FiberMap.ts +22 -22
- package/src/FileSystem.ts +25 -22
- package/src/Graph.ts +105 -105
- package/src/HashMap.ts +11 -5
- package/src/Iterable.ts +13 -13
- package/src/Latch.ts +85 -3
- package/src/Layer.ts +244 -19
- package/src/Number.ts +85 -26
- package/src/Option.ts +2 -0
- package/src/PartitionedSemaphore.ts +414 -0
- package/src/PubSub.ts +7 -6
- package/src/Queue.ts +5 -5
- package/src/Record.ts +52 -47
- package/src/Scheduler.ts +37 -126
- package/src/Schema.ts +2366 -116
- package/src/SchemaAST.ts +2 -2
- package/src/SchemaGetter.ts +4 -4
- package/src/SchemaRepresentation.ts +2 -2
- package/src/SchemaTransformation.ts +27 -27
- package/src/Semaphore.ts +271 -183
- package/src/ServiceMap.ts +83 -31
- package/src/Stream.ts +1 -1
- package/src/String.ts +122 -69
- package/src/SubscriptionRef.ts +96 -117
- package/src/Terminal.ts +2 -1
- package/src/Tracer.ts +6 -5
- package/src/Trie.ts +26 -14
- package/src/TxHashMap.ts +78 -60
- package/src/TxSemaphore.ts +186 -11
- package/src/index.ts +89 -33
- package/src/internal/dateTime.ts +74 -65
- package/src/internal/effect.ts +30 -122
- package/src/internal/hashMap.ts +4 -3
- package/src/internal/option.ts +7 -0
- package/src/internal/trie.ts +6 -6
- package/src/unstable/ai/AiError.ts +1 -1
- package/src/unstable/ai/AnthropicStructuredOutput.ts +4 -0
- package/src/unstable/ai/Chat.ts +17 -15
- package/src/unstable/ai/LanguageModel.ts +148 -97
- package/src/unstable/ai/OpenAiStructuredOutput.ts +4 -0
- package/src/unstable/ai/Tool.ts +20 -0
- package/src/unstable/cli/Argument.ts +2 -4
- package/src/unstable/cli/CliOutput.ts +7 -5
- package/src/unstable/cli/Command.ts +5 -5
- package/src/unstable/cli/Completions.ts +36 -0
- package/src/unstable/cli/Flag.ts +2 -2
- package/src/unstable/cli/GlobalFlag.ts +4 -5
- package/src/unstable/cli/HelpDoc.ts +14 -12
- package/src/unstable/cli/Param.ts +15 -11
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/Prompt.ts +81 -83
- package/src/unstable/cli/index.ts +5 -0
- package/src/unstable/cli/internal/completions/CommandDescriptor.ts +3 -2
- package/src/unstable/cli/internal/parser.ts +7 -4
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +35 -30
- package/src/unstable/cluster/DeliverAt.ts +1 -1
- package/src/unstable/cluster/Entity.ts +13 -12
- package/src/unstable/cluster/Message.ts +6 -5
- package/src/unstable/cluster/MessageStorage.ts +26 -25
- package/src/unstable/cluster/Reply.ts +7 -4
- package/src/unstable/cluster/RunnerServer.ts +10 -13
- package/src/unstable/cluster/Runners.ts +8 -7
- package/src/unstable/cluster/Sharding.ts +24 -17
- package/src/unstable/cluster/ShardingConfig.ts +6 -6
- package/src/unstable/cluster/SqlMessageStorage.ts +21 -18
- package/src/unstable/cluster/internal/entityManager.ts +27 -21
- package/src/unstable/devtools/DevToolsSchema.ts +3 -2
- package/src/unstable/encoding/Ndjson.ts +17 -17
- package/src/unstable/http/Cookies.ts +7 -8
- package/src/unstable/http/Etag.ts +5 -3
- package/src/unstable/http/Headers.ts +6 -5
- package/src/unstable/http/HttpClient.ts +2 -1
- package/src/unstable/http/HttpClientRequest.ts +11 -9
- package/src/unstable/http/HttpClientResponse.ts +5 -4
- package/src/unstable/http/HttpIncomingMessage.ts +3 -2
- package/src/unstable/http/HttpMiddleware.ts +16 -15
- package/src/unstable/http/HttpPlatform.ts +3 -2
- package/src/unstable/http/HttpRouter.ts +9 -9
- package/src/unstable/http/HttpServer.ts +3 -9
- package/src/unstable/http/HttpServerError.ts +3 -2
- package/src/unstable/http/HttpServerRequest.ts +29 -25
- package/src/unstable/http/HttpServerResponse.ts +7 -6
- package/src/unstable/http/HttpTraceContext.ts +31 -17
- package/src/unstable/http/UrlParams.ts +11 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +13 -7
- package/src/unstable/httpapi/HttpApiError.ts +67 -12
- package/src/unstable/observability/OtlpExporter.ts +5 -2
- package/src/unstable/observability/OtlpTracer.ts +8 -4
- package/src/unstable/persistence/Persistable.ts +1 -1
- package/src/unstable/reactivity/Atom.ts +1 -4
- package/src/unstable/reactivity/AtomRegistry.ts +5 -3
- package/src/unstable/rpc/Rpc.ts +4 -3
- package/src/unstable/rpc/RpcClient.ts +10 -9
- package/src/unstable/rpc/RpcGroup.ts +3 -3
- package/src/unstable/rpc/RpcSchema.ts +6 -5
- package/src/unstable/rpc/RpcSerialization.ts +4 -1
- package/src/unstable/rpc/RpcServer.ts +3 -3
- package/src/unstable/socket/Socket.ts +2 -1
- package/src/unstable/sql/SqlClient.ts +5 -3
- package/src/unstable/workflow/DurableDeferred.ts +6 -6
- package/src/unstable/workflow/Workflow.ts +1 -1
- package/src/unstable/workflow/WorkflowEngine.ts +29 -20
- package/dist/NullOr.d.ts +0 -149
- package/dist/NullOr.d.ts.map +0 -1
- package/dist/NullOr.js +0 -152
- package/dist/NullOr.js.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.d.ts +0 -2
- package/dist/unstable/cli/internal/completions/Completions.d.ts.map +0 -1
- package/dist/unstable/cli/internal/completions/Completions.js +0 -23
- package/dist/unstable/cli/internal/completions/Completions.js.map +0 -1
- package/src/NullOr.ts +0 -204
- package/src/unstable/cli/internal/completions/Completions.ts +0 -31
package/src/SubscriptionRef.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { PipeInspectableProto } from "./internal/core.ts"
|
|
|
7
7
|
import * as Option from "./Option.ts"
|
|
8
8
|
import type { Pipeable } from "./Pipeable.ts"
|
|
9
9
|
import * as PubSub from "./PubSub.ts"
|
|
10
|
-
import * as Ref from "./Ref.ts"
|
|
11
10
|
import * as Semaphore from "./Semaphore.ts"
|
|
12
11
|
import * as Stream from "./Stream.ts"
|
|
13
12
|
import type { Invariant } from "./Types.ts"
|
|
@@ -19,7 +18,7 @@ const TypeId = "~effect/SubscriptionRef"
|
|
|
19
18
|
* @category models
|
|
20
19
|
*/
|
|
21
20
|
export interface SubscriptionRef<in out A> extends SubscriptionRef.Variance<A>, Pipeable {
|
|
22
|
-
|
|
21
|
+
value: A
|
|
23
22
|
readonly semaphore: Semaphore.Semaphore
|
|
24
23
|
readonly pubsub: PubSub.PubSub<A>
|
|
25
24
|
}
|
|
@@ -57,7 +56,7 @@ const Proto = {
|
|
|
57
56
|
toJSON(this: SubscriptionRef<unknown>) {
|
|
58
57
|
return {
|
|
59
58
|
_id: "SubscriptionRef",
|
|
60
|
-
value: this.
|
|
59
|
+
value: this.value
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
62
|
}
|
|
@@ -72,7 +71,7 @@ export const make = <A>(value: A): Effect.Effect<SubscriptionRef<A>> =>
|
|
|
72
71
|
Effect.map(PubSub.unbounded<A>({ replay: 1 }), (pubsub) => {
|
|
73
72
|
const self = Object.create(Proto)
|
|
74
73
|
self.semaphore = Semaphore.makeUnsafe(1)
|
|
75
|
-
self.
|
|
74
|
+
self.value = value
|
|
76
75
|
self.pubsub = pubsub
|
|
77
76
|
PubSub.publishUnsafe(self.pubsub, value)
|
|
78
77
|
return self
|
|
@@ -131,7 +130,7 @@ export const changes = <A>(self: SubscriptionRef<A>): Stream.Stream<A> => Stream
|
|
|
131
130
|
* @since 2.0.0
|
|
132
131
|
* @category getters
|
|
133
132
|
*/
|
|
134
|
-
export const getUnsafe = <A>(self: SubscriptionRef<A>): A => self.
|
|
133
|
+
export const getUnsafe = <A>(self: SubscriptionRef<A>): A => self.value
|
|
135
134
|
|
|
136
135
|
/**
|
|
137
136
|
* Retrieves the current value of the `SubscriptionRef`.
|
|
@@ -151,7 +150,7 @@ export const getUnsafe = <A>(self: SubscriptionRef<A>): A => self.backing.ref.cu
|
|
|
151
150
|
* @since 2.0.0
|
|
152
151
|
* @category getters
|
|
153
152
|
*/
|
|
154
|
-
export const get = <A>(self: SubscriptionRef<A>): Effect.Effect<A> => Effect.sync(() =>
|
|
153
|
+
export const get = <A>(self: SubscriptionRef<A>): Effect.Effect<A> => Effect.sync(() => self.value)
|
|
155
154
|
|
|
156
155
|
/**
|
|
157
156
|
* Atomically retrieves the current value and sets a new value, notifying
|
|
@@ -223,10 +222,16 @@ export const getAndSet: {
|
|
|
223
222
|
*/
|
|
224
223
|
<A>(self: SubscriptionRef<A>, value: A): Effect.Effect<A>
|
|
225
224
|
} = dual(2, <A>(self: SubscriptionRef<A>, value: A) =>
|
|
226
|
-
self.semaphore.withPermit(Effect.
|
|
227
|
-
|
|
228
|
-
(
|
|
229
|
-
|
|
225
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
226
|
+
const current = self.value
|
|
227
|
+
setUnsafe(self, value)
|
|
228
|
+
return current
|
|
229
|
+
})))
|
|
230
|
+
|
|
231
|
+
const setUnsafe = <A>(self: SubscriptionRef<A>, value: A) => {
|
|
232
|
+
self.value = value
|
|
233
|
+
PubSub.publishUnsafe(self.pubsub, value)
|
|
234
|
+
}
|
|
230
235
|
|
|
231
236
|
/**
|
|
232
237
|
* Atomically retrieves the current value and updates it with the result of
|
|
@@ -298,11 +303,11 @@ export const getAndUpdate: {
|
|
|
298
303
|
*/
|
|
299
304
|
<A>(self: SubscriptionRef<A>, update: (a: A) => A): Effect.Effect<A>
|
|
300
305
|
} = dual(2, <A>(self: SubscriptionRef<A>, update: (a: A) => A) =>
|
|
301
|
-
self.semaphore.withPermit(Effect.
|
|
302
|
-
const current = self.
|
|
306
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
307
|
+
const current = self.value
|
|
303
308
|
const newValue = update(current)
|
|
304
|
-
self
|
|
305
|
-
return
|
|
309
|
+
setUnsafe(self, newValue)
|
|
310
|
+
return current
|
|
306
311
|
})))
|
|
307
312
|
|
|
308
313
|
/**
|
|
@@ -387,11 +392,11 @@ export const getAndUpdateEffect: {
|
|
|
387
392
|
self: SubscriptionRef<A>,
|
|
388
393
|
update: (a: A) => Effect.Effect<A, E, R>
|
|
389
394
|
) =>
|
|
390
|
-
self.semaphore.withPermit(Effect.
|
|
391
|
-
const current = self.
|
|
392
|
-
return Effect.
|
|
393
|
-
self
|
|
394
|
-
return
|
|
395
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
396
|
+
const current = self.value
|
|
397
|
+
return Effect.map(update(current), (newValue) => {
|
|
398
|
+
setUnsafe(self, newValue)
|
|
399
|
+
return current
|
|
395
400
|
})
|
|
396
401
|
})))
|
|
397
402
|
|
|
@@ -480,14 +485,14 @@ export const getAndUpdateSome: {
|
|
|
480
485
|
self: SubscriptionRef<A>,
|
|
481
486
|
update: (a: A) => Option.Option<A>
|
|
482
487
|
) =>
|
|
483
|
-
self.semaphore.withPermit(Effect.
|
|
484
|
-
const current = self.
|
|
488
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
489
|
+
const current = self.value
|
|
485
490
|
const option = update(current)
|
|
486
491
|
if (Option.isNone(option)) {
|
|
487
492
|
return Effect.succeed(current)
|
|
488
493
|
}
|
|
489
|
-
self
|
|
490
|
-
return
|
|
494
|
+
setUnsafe(self, option.value)
|
|
495
|
+
return current
|
|
491
496
|
})))
|
|
492
497
|
|
|
493
498
|
/**
|
|
@@ -579,13 +584,11 @@ export const getAndUpdateSomeEffect: {
|
|
|
579
584
|
update: (a: A) => Effect.Effect<Option.Option<A>, E, R>
|
|
580
585
|
) =>
|
|
581
586
|
self.semaphore.withPermit(Effect.suspend(() => {
|
|
582
|
-
const current = self.
|
|
583
|
-
return Effect.
|
|
584
|
-
if (Option.isNone(option))
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
self.backing.ref.current = option.value
|
|
588
|
-
return Effect.as(PubSub.publish(self.pubsub, option.value), current)
|
|
587
|
+
const current = self.value
|
|
588
|
+
return Effect.map(update(current), (option) => {
|
|
589
|
+
if (Option.isNone(option)) return current
|
|
590
|
+
setUnsafe(self, option.value)
|
|
591
|
+
return current
|
|
589
592
|
})
|
|
590
593
|
})))
|
|
591
594
|
|
|
@@ -671,10 +674,10 @@ export const modify: {
|
|
|
671
674
|
self: SubscriptionRef<A>,
|
|
672
675
|
modify: (a: A) => readonly [B, A]
|
|
673
676
|
) =>
|
|
674
|
-
self.semaphore.withPermit(Effect.
|
|
675
|
-
const [b, newValue] = modify(self.
|
|
676
|
-
self
|
|
677
|
-
return
|
|
677
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
678
|
+
const [b, newValue] = modify(self.value)
|
|
679
|
+
setUnsafe(self, newValue)
|
|
680
|
+
return b
|
|
678
681
|
})))
|
|
679
682
|
|
|
680
683
|
/**
|
|
@@ -765,13 +768,12 @@ export const modifyEffect: {
|
|
|
765
768
|
self: SubscriptionRef<A>,
|
|
766
769
|
modify: (a: A) => Effect.Effect<readonly [B, A], E, R>
|
|
767
770
|
): Effect.Effect<B, E, R> =>
|
|
768
|
-
self.semaphore.withPermit(Effect.suspend(() =>
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
return Effect.as(PubSub.publish(self.pubsub, newValue), b)
|
|
771
|
+
self.semaphore.withPermit(Effect.suspend(() =>
|
|
772
|
+
Effect.map(modify(self.value), ([b, newValue]) => {
|
|
773
|
+
setUnsafe(self, newValue)
|
|
774
|
+
return b
|
|
773
775
|
})
|
|
774
|
-
|
|
776
|
+
)))
|
|
775
777
|
|
|
776
778
|
/**
|
|
777
779
|
* Atomically modifies the `SubscriptionRef` with a function that computes a
|
|
@@ -861,13 +863,11 @@ export const modifySome: {
|
|
|
861
863
|
self: SubscriptionRef<A>,
|
|
862
864
|
modify: (a: A) => readonly [B, Option.Option<A>]
|
|
863
865
|
) =>
|
|
864
|
-
self.semaphore.withPermit(Effect.
|
|
865
|
-
const [b, option] = modify(self.
|
|
866
|
-
if (Option.isNone(option))
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
self.backing.ref.current = option.value
|
|
870
|
-
return Effect.as(PubSub.publish(self.pubsub, option.value), b)
|
|
866
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
867
|
+
const [b, option] = modify(self.value)
|
|
868
|
+
if (Option.isNone(option)) return b
|
|
869
|
+
setUnsafe(self, option.value)
|
|
870
|
+
return b
|
|
871
871
|
})))
|
|
872
872
|
|
|
873
873
|
/**
|
|
@@ -973,16 +973,13 @@ export const modifySomeEffect: {
|
|
|
973
973
|
self: SubscriptionRef<A>,
|
|
974
974
|
modify: (a: A) => Effect.Effect<readonly [B, Option.Option<A>], E, R>
|
|
975
975
|
) =>
|
|
976
|
-
self.semaphore.withPermit(Effect.suspend(() =>
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
}
|
|
982
|
-
self.backing.ref.current = option.value
|
|
983
|
-
return Effect.as(PubSub.publish(self.pubsub, option.value), b)
|
|
976
|
+
self.semaphore.withPermit(Effect.suspend(() =>
|
|
977
|
+
Effect.map(modify(self.value), ([b, option]) => {
|
|
978
|
+
if (Option.isNone(option)) return b
|
|
979
|
+
setUnsafe(self, option.value)
|
|
980
|
+
return b
|
|
984
981
|
})
|
|
985
|
-
|
|
982
|
+
)))
|
|
986
983
|
|
|
987
984
|
/**
|
|
988
985
|
* Sets the value of the `SubscriptionRef`, notifying all subscribers of the
|
|
@@ -1050,11 +1047,10 @@ export const set: {
|
|
|
1050
1047
|
* @category setters
|
|
1051
1048
|
*/
|
|
1052
1049
|
<A>(self: SubscriptionRef<A>, value: A): Effect.Effect<void>
|
|
1053
|
-
} = dual(
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
})))
|
|
1050
|
+
} = dual(
|
|
1051
|
+
2,
|
|
1052
|
+
<A>(self: SubscriptionRef<A>, value: A) => self.semaphore.withPermit(Effect.sync(() => setUnsafe(self, value)))
|
|
1053
|
+
)
|
|
1058
1054
|
|
|
1059
1055
|
/**
|
|
1060
1056
|
* Sets the value of the `SubscriptionRef` and returns the new value,
|
|
@@ -1117,9 +1113,9 @@ export const setAndGet: {
|
|
|
1117
1113
|
*/
|
|
1118
1114
|
<A>(self: SubscriptionRef<A>, value: A): Effect.Effect<A>
|
|
1119
1115
|
} = dual(2, <A>(self: SubscriptionRef<A>, value: A) =>
|
|
1120
|
-
self.semaphore.withPermit(Effect.
|
|
1121
|
-
self
|
|
1122
|
-
return
|
|
1116
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
1117
|
+
setUnsafe(self, value)
|
|
1118
|
+
return value
|
|
1123
1119
|
})))
|
|
1124
1120
|
|
|
1125
1121
|
/**
|
|
@@ -1188,12 +1184,11 @@ export const update: {
|
|
|
1188
1184
|
* @category updating
|
|
1189
1185
|
*/
|
|
1190
1186
|
<A>(self: SubscriptionRef<A>, update: (a: A) => A): Effect.Effect<void>
|
|
1191
|
-
} = dual(
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
self.
|
|
1195
|
-
|
|
1196
|
-
})))
|
|
1187
|
+
} = dual(
|
|
1188
|
+
2,
|
|
1189
|
+
<A>(self: SubscriptionRef<A>, update: (a: A) => A) =>
|
|
1190
|
+
self.semaphore.withPermit(Effect.sync(() => setUnsafe(self, update(self.value))))
|
|
1191
|
+
)
|
|
1197
1192
|
|
|
1198
1193
|
/**
|
|
1199
1194
|
* Updates the value of the `SubscriptionRef` with the result of applying an
|
|
@@ -1265,13 +1260,9 @@ export const updateEffect: {
|
|
|
1265
1260
|
self: SubscriptionRef<A>,
|
|
1266
1261
|
update: (a: A) => Effect.Effect<A, E, R>
|
|
1267
1262
|
) =>
|
|
1268
|
-
self.semaphore.withPermit(
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
self.backing.ref.current = newValue
|
|
1272
|
-
return Effect.asVoid(PubSub.publish(self.pubsub, newValue))
|
|
1273
|
-
})
|
|
1274
|
-
})))
|
|
1263
|
+
self.semaphore.withPermit(
|
|
1264
|
+
Effect.suspend(() => Effect.map(update(self.value), (newValue) => setUnsafe(self, newValue)))
|
|
1265
|
+
))
|
|
1275
1266
|
|
|
1276
1267
|
/**
|
|
1277
1268
|
* Updates the value of the `SubscriptionRef` with the result of applying a
|
|
@@ -1334,10 +1325,10 @@ export const updateAndGet: {
|
|
|
1334
1325
|
*/
|
|
1335
1326
|
<A>(self: SubscriptionRef<A>, update: (a: A) => A): Effect.Effect<A>
|
|
1336
1327
|
} = dual(2, <A>(self: SubscriptionRef<A>, update: (a: A) => A) =>
|
|
1337
|
-
self.semaphore.withPermit(Effect.
|
|
1338
|
-
const newValue = update(self.
|
|
1339
|
-
self
|
|
1340
|
-
return
|
|
1328
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
1329
|
+
const newValue = update(self.value)
|
|
1330
|
+
setUnsafe(self, newValue)
|
|
1331
|
+
return newValue
|
|
1341
1332
|
})))
|
|
1342
1333
|
|
|
1343
1334
|
/**
|
|
@@ -1416,13 +1407,12 @@ export const updateAndGetEffect: {
|
|
|
1416
1407
|
self: SubscriptionRef<A>,
|
|
1417
1408
|
update: (a: A) => Effect.Effect<A, E, R>
|
|
1418
1409
|
) =>
|
|
1419
|
-
self.semaphore.withPermit(Effect.suspend(() =>
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
return Effect.as(PubSub.publish(self.pubsub, newValue), newValue)
|
|
1410
|
+
self.semaphore.withPermit(Effect.suspend(() =>
|
|
1411
|
+
Effect.map(update(self.value), (newValue) => {
|
|
1412
|
+
setUnsafe(self, newValue)
|
|
1413
|
+
return newValue
|
|
1424
1414
|
})
|
|
1425
|
-
|
|
1415
|
+
)))
|
|
1426
1416
|
|
|
1427
1417
|
/**
|
|
1428
1418
|
* Optionally updates the value of the `SubscriptionRef` with the result of
|
|
@@ -1506,13 +1496,10 @@ export const updateSome: {
|
|
|
1506
1496
|
self: SubscriptionRef<A>,
|
|
1507
1497
|
update: (a: A) => Option.Option<A>
|
|
1508
1498
|
) =>
|
|
1509
|
-
self.semaphore.withPermit(Effect.
|
|
1510
|
-
const option = update(self.
|
|
1511
|
-
if (Option.isNone(option))
|
|
1512
|
-
|
|
1513
|
-
}
|
|
1514
|
-
self.backing.ref.current = option.value
|
|
1515
|
-
return Effect.asVoid(PubSub.publish(self.pubsub, option.value))
|
|
1499
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
1500
|
+
const option = update(self.value)
|
|
1501
|
+
if (Option.isNone(option)) return
|
|
1502
|
+
setUnsafe(self, option.value)
|
|
1516
1503
|
})))
|
|
1517
1504
|
|
|
1518
1505
|
/**
|
|
@@ -1600,16 +1587,12 @@ export const updateSomeEffect: {
|
|
|
1600
1587
|
self: SubscriptionRef<A>,
|
|
1601
1588
|
update: (a: A) => Effect.Effect<Option.Option<A>, E, R>
|
|
1602
1589
|
) =>
|
|
1603
|
-
self.semaphore.withPermit(Effect.suspend(() =>
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
return Effect.void
|
|
1608
|
-
}
|
|
1609
|
-
self.backing.ref.current = option.value
|
|
1610
|
-
return Effect.asVoid(PubSub.publish(self.pubsub, option.value))
|
|
1590
|
+
self.semaphore.withPermit(Effect.suspend(() =>
|
|
1591
|
+
Effect.map(update(self.value), (option) => {
|
|
1592
|
+
if (Option.isNone(option)) return
|
|
1593
|
+
setUnsafe(self, option.value)
|
|
1611
1594
|
})
|
|
1612
|
-
|
|
1595
|
+
)))
|
|
1613
1596
|
|
|
1614
1597
|
/**
|
|
1615
1598
|
* Optionally updates the value of the `SubscriptionRef` with the result of
|
|
@@ -1687,14 +1670,12 @@ export const updateSomeAndGet: {
|
|
|
1687
1670
|
self: SubscriptionRef<A>,
|
|
1688
1671
|
update: (a: A) => Option.Option<A>
|
|
1689
1672
|
) =>
|
|
1690
|
-
self.semaphore.withPermit(Effect.
|
|
1691
|
-
const current = self.
|
|
1673
|
+
self.semaphore.withPermit(Effect.sync(() => {
|
|
1674
|
+
const current = self.value
|
|
1692
1675
|
const option = update(current)
|
|
1693
|
-
if (Option.isNone(option))
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
self.backing.ref.current = option.value
|
|
1697
|
-
return Effect.as(PubSub.publish(self.pubsub, option.value), option.value)
|
|
1676
|
+
if (Option.isNone(option)) return current
|
|
1677
|
+
setUnsafe(self, option.value)
|
|
1678
|
+
return option.value
|
|
1698
1679
|
})))
|
|
1699
1680
|
|
|
1700
1681
|
/**
|
|
@@ -1777,12 +1758,10 @@ export const updateSomeAndGetEffect: {
|
|
|
1777
1758
|
update: (a: A) => Effect.Effect<Option.Option<A>, E, R>
|
|
1778
1759
|
) =>
|
|
1779
1760
|
self.semaphore.withPermit(Effect.suspend(() => {
|
|
1780
|
-
const current = self.
|
|
1781
|
-
return Effect.
|
|
1782
|
-
if (Option.isNone(option))
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
self.backing.ref.current = option.value
|
|
1786
|
-
return Effect.as(PubSub.publish(self.pubsub, option.value), option.value)
|
|
1761
|
+
const current = self.value
|
|
1762
|
+
return Effect.map(update(current), (option) => {
|
|
1763
|
+
if (Option.isNone(option)) return current
|
|
1764
|
+
setUnsafe(self, option.value)
|
|
1765
|
+
return option.value
|
|
1787
1766
|
})
|
|
1788
1767
|
})))
|
package/src/Terminal.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type * as Cause from "./Cause.ts"
|
|
5
5
|
import type * as Effect from "./Effect.ts"
|
|
6
|
+
import type * as Option from "./Option.ts"
|
|
6
7
|
import type { PlatformError } from "./PlatformError.ts"
|
|
7
8
|
import * as Predicate from "./Predicate.ts"
|
|
8
9
|
import type * as Queue from "./Queue.ts"
|
|
@@ -71,7 +72,7 @@ export interface UserInput {
|
|
|
71
72
|
/**
|
|
72
73
|
* The character read from the user (if any).
|
|
73
74
|
*/
|
|
74
|
-
readonly input: string
|
|
75
|
+
readonly input: Option.Option<string>
|
|
75
76
|
/**
|
|
76
77
|
* The key that the user pressed.
|
|
77
78
|
*/
|
package/src/Tracer.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { Fiber } from "./Fiber.ts"
|
|
|
6
6
|
import { constFalse, type LazyArg } from "./Function.ts"
|
|
7
7
|
import type * as core from "./internal/core.ts"
|
|
8
8
|
import type { LogLevel } from "./LogLevel.ts"
|
|
9
|
+
import * as Option from "./Option.ts"
|
|
9
10
|
import * as ServiceMap from "./ServiceMap.ts"
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -15,7 +16,7 @@ import * as ServiceMap from "./ServiceMap.ts"
|
|
|
15
16
|
export interface Tracer {
|
|
16
17
|
span(this: Tracer, options: {
|
|
17
18
|
readonly name: string
|
|
18
|
-
readonly parent: AnySpan
|
|
19
|
+
readonly parent: Option.Option<AnySpan>
|
|
19
20
|
readonly annotations: ServiceMap.ServiceMap<never>
|
|
20
21
|
readonly links: Array<SpanLink>
|
|
21
22
|
readonly startTime: bigint
|
|
@@ -241,7 +242,7 @@ export interface Span {
|
|
|
241
242
|
readonly name: string
|
|
242
243
|
readonly spanId: string
|
|
243
244
|
readonly traceId: string
|
|
244
|
-
readonly parent: AnySpan
|
|
245
|
+
readonly parent: Option.Option<AnySpan>
|
|
245
246
|
readonly annotations: ServiceMap.ServiceMap<never>
|
|
246
247
|
readonly status: SpanStatus
|
|
247
248
|
readonly attributes: ReadonlyMap<string, unknown>
|
|
@@ -410,7 +411,7 @@ export class NativeSpan implements Span {
|
|
|
410
411
|
readonly sampled: boolean
|
|
411
412
|
|
|
412
413
|
readonly name: string
|
|
413
|
-
readonly parent: AnySpan
|
|
414
|
+
readonly parent: Option.Option<AnySpan>
|
|
414
415
|
readonly annotations: ServiceMap.ServiceMap<never>
|
|
415
416
|
readonly links: Array<SpanLink>
|
|
416
417
|
readonly startTime: bigint
|
|
@@ -422,7 +423,7 @@ export class NativeSpan implements Span {
|
|
|
422
423
|
|
|
423
424
|
constructor(options: {
|
|
424
425
|
readonly name: string
|
|
425
|
-
readonly parent: AnySpan
|
|
426
|
+
readonly parent: Option.Option<AnySpan>
|
|
426
427
|
readonly annotations: ServiceMap.ServiceMap<never>
|
|
427
428
|
readonly links: Array<SpanLink>
|
|
428
429
|
readonly startTime: bigint
|
|
@@ -441,7 +442,7 @@ export class NativeSpan implements Span {
|
|
|
441
442
|
startTime: options.startTime
|
|
442
443
|
}
|
|
443
444
|
this.attributes = new Map()
|
|
444
|
-
this.traceId = options.parent?.traceId ?? randomHexString(32)
|
|
445
|
+
this.traceId = Option.getOrUndefined(options.parent)?.traceId ?? randomHexString(32)
|
|
445
446
|
this.spanId = randomHexString(16)
|
|
446
447
|
}
|
|
447
448
|
|
package/src/Trie.ts
CHANGED
|
@@ -647,10 +647,14 @@ export const toEntriesWithPrefix: {
|
|
|
647
647
|
* Trie.insert("she", 2)
|
|
648
648
|
* )
|
|
649
649
|
*
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* assert.
|
|
650
|
+
* const none = Trie.longestPrefixOf(trie, "sell")
|
|
651
|
+
* const some = Trie.longestPrefixOf(trie, "sells")
|
|
652
|
+
*
|
|
653
|
+
* assert.equal(none._tag, "None")
|
|
654
|
+
* assert.equal(some._tag, "Some")
|
|
655
|
+
* if (some._tag === "Some") {
|
|
656
|
+
* assert.deepStrictEqual(some.value, ["sells", 1])
|
|
657
|
+
* }
|
|
654
658
|
* ```
|
|
655
659
|
*
|
|
656
660
|
* @since 2.0.0
|
|
@@ -672,16 +676,20 @@ export const longestPrefixOf: {
|
|
|
672
676
|
* Trie.insert("she", 2)
|
|
673
677
|
* )
|
|
674
678
|
*
|
|
675
|
-
*
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
* assert.
|
|
679
|
+
* const none = Trie.longestPrefixOf(trie, "sell")
|
|
680
|
+
* const some = Trie.longestPrefixOf(trie, "sells")
|
|
681
|
+
*
|
|
682
|
+
* assert.equal(none._tag, "None")
|
|
683
|
+
* assert.equal(some._tag, "Some")
|
|
684
|
+
* if (some._tag === "Some") {
|
|
685
|
+
* assert.deepStrictEqual(some.value, ["sells", 1])
|
|
686
|
+
* }
|
|
679
687
|
* ```
|
|
680
688
|
*
|
|
681
689
|
* @since 2.0.0
|
|
682
690
|
* @category getters
|
|
683
691
|
*/
|
|
684
|
-
(key: string): <V>(self: Trie<V>) => [string, V]
|
|
692
|
+
(key: string): <V>(self: Trie<V>) => Option<[string, V]>
|
|
685
693
|
/**
|
|
686
694
|
* Returns the longest key/value in the `Trie`
|
|
687
695
|
* that is a prefix of that `key` if it exists, `None` otherwise.
|
|
@@ -697,16 +705,20 @@ export const longestPrefixOf: {
|
|
|
697
705
|
* Trie.insert("she", 2)
|
|
698
706
|
* )
|
|
699
707
|
*
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
*
|
|
703
|
-
* assert.
|
|
708
|
+
* const none = Trie.longestPrefixOf(trie, "sell")
|
|
709
|
+
* const some = Trie.longestPrefixOf(trie, "sells")
|
|
710
|
+
*
|
|
711
|
+
* assert.equal(none._tag, "None")
|
|
712
|
+
* assert.equal(some._tag, "Some")
|
|
713
|
+
* if (some._tag === "Some") {
|
|
714
|
+
* assert.deepStrictEqual(some.value, ["sells", 1])
|
|
715
|
+
* }
|
|
704
716
|
* ```
|
|
705
717
|
*
|
|
706
718
|
* @since 2.0.0
|
|
707
719
|
* @category getters
|
|
708
720
|
*/
|
|
709
|
-
<V>(self: Trie<V>, key: string): [string, V]
|
|
721
|
+
<V>(self: Trie<V>, key: string): Option<[string, V]>
|
|
710
722
|
} = TR.longestPrefixOf
|
|
711
723
|
|
|
712
724
|
/**
|