effect 4.0.0-beta.94 → 4.0.0-beta.97
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.map +1 -1
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +44 -6
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +63 -24
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts.map +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Cron.d.ts +4 -1
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +98 -53
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/DateTime.d.ts +12 -12
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ExecutionPlan.d.ts +2 -2
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/FiberHandle.d.ts +8 -8
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberMap.d.ts +8 -8
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberSet.d.ts +4 -4
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Function.d.ts.map +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Layer.d.ts.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerRef.d.ts +1 -1
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/Logger.d.ts.map +1 -1
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/Metric.d.ts.map +1 -1
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/Number.d.ts.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Order.d.ts.map +1 -1
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/Record.d.ts.map +1 -1
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Ref.d.ts.map +1 -1
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Schedule.d.ts +1206 -4013
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +244 -1348
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +49 -0
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +40 -0
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -106
- package/dist/SchemaTransformation.d.ts +38 -2
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +38 -2
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stream.d.ts +2 -2
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1 -1
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/Take.d.ts.map +1 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/Types.d.ts +1 -1
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/Utils.d.ts.map +1 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +1 -1
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +1 -1
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +221 -221
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +25 -29
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +8 -8
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +3 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +6 -8
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +1 -1
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +11 -12
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +2 -2
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +21 -21
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +3 -4
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +1 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +1 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +2 -2
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +2 -1
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +22 -22
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +1 -1
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +3 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +2 -2
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +28 -37
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +2 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +5 -5
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +7 -7
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +2 -2
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +8 -8
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +2 -2
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +5 -5
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/schema/Model.d.ts +24 -38
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -1
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +1 -1
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +1 -1
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/package.json +11 -12
- package/src/ConfigProvider.ts +79 -27
- package/src/Cron.ts +109 -57
- package/src/Schedule.ts +1437 -4445
- package/src/Schema.ts +53 -0
- package/src/SchemaTransformation.ts +42 -2
- package/src/Stream.ts +1 -1
- package/src/unstable/cluster/ClusterCron.ts +4 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -3
- package/src/unstable/cluster/Sharding.ts +4 -4
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/internal/entityManager.ts +16 -16
- package/src/unstable/eventlog/EventLog.ts +4 -3
- package/src/unstable/observability/OtlpExporter.ts +1 -1
- package/src/unstable/reactivity/AtomRegistry.ts +35 -44
- package/src/unstable/rpc/RpcClient.ts +10 -9
- package/src/unstable/rpc/RpcMessage.ts +8 -9
- package/src/unstable/rpc/RpcSerialization.ts +16 -16
- package/src/unstable/rpc/RpcServer.ts +5 -5
- package/src/unstable/workflow/Activity.ts +6 -5
- package/src/unstable/workflow/DurableQueue.ts +4 -3
- package/src/unstable/workflow/WorkflowEngine.ts +4 -3
package/src/Schema.ts
CHANGED
|
@@ -10451,6 +10451,8 @@ const DateString = String.annotate({ expected: "a string in ISO 8601 format that
|
|
|
10451
10451
|
* ```
|
|
10452
10452
|
*
|
|
10453
10453
|
* @see {@link DateValid} for accepting only valid Date instances
|
|
10454
|
+
* @see {@link DateFromString} for decoding strings into Date instances
|
|
10455
|
+
* @see {@link DateFromMillis} for decoding epoch milliseconds into Date instances
|
|
10454
10456
|
*
|
|
10455
10457
|
* @category Date
|
|
10456
10458
|
* @since 4.0.0
|
|
@@ -10510,6 +10512,8 @@ export interface DateFromString extends decodeTo<Date, String> {
|
|
|
10510
10512
|
*
|
|
10511
10513
|
* Invalid date strings can decode to invalid `Date` instances.
|
|
10512
10514
|
*
|
|
10515
|
+
* @see {@link DateFromMillis} for decoding epoch milliseconds into Date instances
|
|
10516
|
+
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
10513
10517
|
* @see {@link Date} for accepting Date instances directly
|
|
10514
10518
|
* @see {@link DateValid} for rejecting invalid Date instances
|
|
10515
10519
|
*
|
|
@@ -10518,6 +10522,47 @@ export interface DateFromString extends decodeTo<Date, String> {
|
|
|
10518
10522
|
*/
|
|
10519
10523
|
export const DateFromString: DateFromString = DateString.pipe(decodeTo(Date, SchemaTransformation.dateFromString))
|
|
10520
10524
|
|
|
10525
|
+
/**
|
|
10526
|
+
* Type-level representation of {@link DateFromMillis}.
|
|
10527
|
+
*
|
|
10528
|
+
* @category Date
|
|
10529
|
+
* @since 4.0.0
|
|
10530
|
+
*/
|
|
10531
|
+
export interface DateFromMillis extends decodeTo<Date, Number> {
|
|
10532
|
+
readonly "Rebuild": DateFromMillis
|
|
10533
|
+
}
|
|
10534
|
+
|
|
10535
|
+
/**
|
|
10536
|
+
* Schema that decodes epoch milliseconds into a JavaScript `Date`.
|
|
10537
|
+
*
|
|
10538
|
+
* **When to use**
|
|
10539
|
+
*
|
|
10540
|
+
* Use to model numeric millisecond timestamps that decode to JavaScript `Date`
|
|
10541
|
+
* objects and encode back to numbers.
|
|
10542
|
+
*
|
|
10543
|
+
* **Details**
|
|
10544
|
+
*
|
|
10545
|
+
* Decoding:
|
|
10546
|
+
* A number of milliseconds since the Unix epoch is decoded as a `Date`.
|
|
10547
|
+
*
|
|
10548
|
+
* Encoding:
|
|
10549
|
+
* A `Date` is encoded as its millisecond timestamp.
|
|
10550
|
+
*
|
|
10551
|
+
* **Gotchas**
|
|
10552
|
+
*
|
|
10553
|
+
* This schema accepts any number, including `NaN`, `Infinity`, and `-Infinity`.
|
|
10554
|
+
* Those values decode to invalid `Date` instances.
|
|
10555
|
+
*
|
|
10556
|
+
* @see {@link DateFromString} for decoding string-encoded dates
|
|
10557
|
+
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
10558
|
+
*
|
|
10559
|
+
* @category Date
|
|
10560
|
+
* @since 4.0.0
|
|
10561
|
+
*/
|
|
10562
|
+
export const DateFromMillis: DateFromMillis = Number.pipe(
|
|
10563
|
+
decodeTo(Date, SchemaTransformation.dateFromMillis)
|
|
10564
|
+
)
|
|
10565
|
+
|
|
10521
10566
|
/**
|
|
10522
10567
|
* Type-level representation of {@link DateValid}.
|
|
10523
10568
|
*
|
|
@@ -12064,6 +12109,10 @@ export interface DateTimeUtcFromString extends decodeTo<DateTimeUtc, String> {
|
|
|
12064
12109
|
*
|
|
12065
12110
|
* - A `DateTime.Utc` is encoded as a UTC ISO 8601 string.
|
|
12066
12111
|
*
|
|
12112
|
+
* @see {@link DateTimeUtcFromDate} for decoding JavaScript Date values into UTC values
|
|
12113
|
+
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
12114
|
+
* @see {@link DateFromString} for decoding strings into JavaScript Date instances
|
|
12115
|
+
*
|
|
12067
12116
|
* @category DateTime
|
|
12068
12117
|
* @since 4.0.0
|
|
12069
12118
|
*/
|
|
@@ -12097,6 +12146,10 @@ export interface DateTimeUtcFromMillis extends decodeTo<instanceOf<DateTime.Utc>
|
|
|
12097
12146
|
* Encoding:
|
|
12098
12147
|
* - A `DateTime.Utc` is encoded as a number of milliseconds since the Unix epoch.
|
|
12099
12148
|
*
|
|
12149
|
+
* @see {@link DateTimeUtcFromDate} for decoding JavaScript Date values into UTC values
|
|
12150
|
+
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
12151
|
+
* @see {@link DateFromMillis} for decoding epoch milliseconds into JavaScript Date instances
|
|
12152
|
+
*
|
|
12100
12153
|
* @category DateTime
|
|
12101
12154
|
* @since 4.0.0
|
|
12102
12155
|
*/
|
|
@@ -871,7 +871,7 @@ export const bigintFromString = new Transformation(
|
|
|
871
871
|
* )
|
|
872
872
|
* ```
|
|
873
873
|
*
|
|
874
|
-
* @see {@link
|
|
874
|
+
* @see {@link dateFromMillis}
|
|
875
875
|
* @see {@link dateTimeUtcFromString}
|
|
876
876
|
*
|
|
877
877
|
* @category Coercions
|
|
@@ -882,6 +882,46 @@ export const dateFromString: Transformation<globalThis.Date, string> = new Trans
|
|
|
882
882
|
SchemaGetter.transform(formatDate)
|
|
883
883
|
)
|
|
884
884
|
|
|
885
|
+
/**
|
|
886
|
+
* Decodes epoch milliseconds into a `Date` and encodes a `Date` back to epoch
|
|
887
|
+
* milliseconds.
|
|
888
|
+
*
|
|
889
|
+
* **When to use**
|
|
890
|
+
*
|
|
891
|
+
* Use when you need a schema transformation for numeric timestamps represented
|
|
892
|
+
* as milliseconds since the Unix epoch.
|
|
893
|
+
*
|
|
894
|
+
* **Details**
|
|
895
|
+
*
|
|
896
|
+
* Decoding creates a `Date` from the number like `new Date(ms)`. Encoding
|
|
897
|
+
* returns the `Date` timestamp like `date.getTime()`.
|
|
898
|
+
*
|
|
899
|
+
* **Gotchas**
|
|
900
|
+
*
|
|
901
|
+
* This transformation does not validate date validity. `NaN`, `Infinity`, and
|
|
902
|
+
* `-Infinity` decode to invalid `Date` instances.
|
|
903
|
+
*
|
|
904
|
+
* **Example** (Converting milliseconds to a Date)
|
|
905
|
+
*
|
|
906
|
+
* ```ts
|
|
907
|
+
* import { Schema, SchemaTransformation } from "effect"
|
|
908
|
+
*
|
|
909
|
+
* const schema = Schema.Number.pipe(
|
|
910
|
+
* Schema.decodeTo(Schema.Date, SchemaTransformation.dateFromMillis)
|
|
911
|
+
* )
|
|
912
|
+
* ```
|
|
913
|
+
*
|
|
914
|
+
* @see {@link dateFromString}
|
|
915
|
+
* @see {@link SchemaGetter.dateTimeUtcFromInput}
|
|
916
|
+
*
|
|
917
|
+
* @category Coercions
|
|
918
|
+
* @since 4.0.0
|
|
919
|
+
*/
|
|
920
|
+
export const dateFromMillis: Transformation<globalThis.Date, number> = new Transformation(
|
|
921
|
+
SchemaGetter.Date(),
|
|
922
|
+
SchemaGetter.transform((date) => date.getTime())
|
|
923
|
+
)
|
|
924
|
+
|
|
885
925
|
/**
|
|
886
926
|
* Decodes a `string` into a `Duration` and encodes a `Duration` back to a
|
|
887
927
|
* parseable `string`.
|
|
@@ -1762,8 +1802,8 @@ export const timeZoneFromString: Transformation<DateTime.TimeZone, string> = tra
|
|
|
1762
1802
|
* UTC, and fails with `InvalidValue` when parsing fails. Encode uses
|
|
1763
1803
|
* `DateTime.formatIso`.
|
|
1764
1804
|
*
|
|
1765
|
-
* @see {@link dateTimeZonedFromString} for ISO strings that should preserve zoned date-time information
|
|
1766
1805
|
* @see {@link dateFromString} for decoding into JavaScript `Date`
|
|
1806
|
+
* @see {@link dateTimeZonedFromString} for ISO strings that should preserve zoned date-time information
|
|
1767
1807
|
*
|
|
1768
1808
|
* @category transforming
|
|
1769
1809
|
* @since 4.0.0
|
package/src/Stream.ts
CHANGED
|
@@ -1471,7 +1471,7 @@ export const fromAsyncIterable = <A, E>(
|
|
|
1471
1471
|
*
|
|
1472
1472
|
* const program = Effect.gen(function*() {
|
|
1473
1473
|
* const schedule = Schedule.spaced("50 millis").pipe(
|
|
1474
|
-
* Schedule.
|
|
1474
|
+
* Schedule.upTo({ times: 3 })
|
|
1475
1475
|
* )
|
|
1476
1476
|
* const stream = Stream.fromSchedule(schedule)
|
|
1477
1477
|
* const values = yield* Stream.runCollect(stream)
|
|
@@ -147,9 +147,10 @@ export const make = <E, R>(options: {
|
|
|
147
147
|
return Layer.merge(InitialRun, EntityLayer)
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
const retryPolicy = Schedule.
|
|
151
|
-
Schedule.
|
|
152
|
-
)
|
|
150
|
+
const retryPolicy = Schedule.min([
|
|
151
|
+
Schedule.exponential(200, 1.5),
|
|
152
|
+
Schedule.spaced("1 minute")
|
|
153
|
+
])
|
|
153
154
|
|
|
154
155
|
class CronPayload extends Schema.Class<CronPayload>("effect/cluster/ClusterCron/CronPayload")({
|
|
155
156
|
dateTime: Schema.DateTimeUtc
|
|
@@ -626,9 +626,10 @@ export const make = Effect.gen(function*() {
|
|
|
626
626
|
return engine
|
|
627
627
|
})
|
|
628
628
|
|
|
629
|
-
const retryPolicy = Schedule.
|
|
630
|
-
Schedule.
|
|
631
|
-
)
|
|
629
|
+
const retryPolicy = Schedule.min([
|
|
630
|
+
Schedule.exponential(200, 1.5),
|
|
631
|
+
Schedule.spaced("1 minute")
|
|
632
|
+
])
|
|
632
633
|
|
|
633
634
|
const ensureSuccess = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|
634
635
|
effect.pipe(
|
|
@@ -38,7 +38,7 @@ import * as Semaphore from "../../Semaphore.ts"
|
|
|
38
38
|
import * as Stream from "../../Stream.ts"
|
|
39
39
|
import type * as Rpc from "../rpc/Rpc.ts"
|
|
40
40
|
import * as RpcClient from "../rpc/RpcClient.ts"
|
|
41
|
-
import {
|
|
41
|
+
import type { FromServer } from "../rpc/RpcMessage.ts"
|
|
42
42
|
import type { MailboxFull, PersistenceError } from "./ClusterError.ts"
|
|
43
43
|
import { AlreadyProcessingMessage, EntityNotAssignedToRunner } from "./ClusterError.ts"
|
|
44
44
|
import * as ClusterMetrics from "./ClusterMetrics.ts"
|
|
@@ -1040,7 +1040,7 @@ const make = Effect.gen(function*() {
|
|
|
1040
1040
|
spanPrefix: `${entity.type}.client`,
|
|
1041
1041
|
disableTracing: !Context.get(entity.protocol.annotations, ClusterSchema.ClientTracingEnabled),
|
|
1042
1042
|
supportsAck: true,
|
|
1043
|
-
generateRequestId: () =>
|
|
1043
|
+
generateRequestId: () => snowflakeGen.nextUnsafe() as any,
|
|
1044
1044
|
flatten: true,
|
|
1045
1045
|
onFromClient(options): Effect.Effect<
|
|
1046
1046
|
void,
|
|
@@ -1199,7 +1199,7 @@ const make = Effect.gen(function*() {
|
|
|
1199
1199
|
return write({
|
|
1200
1200
|
_tag: "Chunk",
|
|
1201
1201
|
clientId: 0,
|
|
1202
|
-
requestId:
|
|
1202
|
+
requestId: reply.requestId as any,
|
|
1203
1203
|
values: reply.values
|
|
1204
1204
|
})
|
|
1205
1205
|
}
|
|
@@ -1208,7 +1208,7 @@ const make = Effect.gen(function*() {
|
|
|
1208
1208
|
return write({
|
|
1209
1209
|
_tag: "Exit",
|
|
1210
1210
|
clientId: 0,
|
|
1211
|
-
requestId:
|
|
1211
|
+
requestId: reply.requestId as any,
|
|
1212
1212
|
exit: reply.exit
|
|
1213
1213
|
})
|
|
1214
1214
|
}
|
|
@@ -53,8 +53,8 @@ export type Snowflake = Brand.Branded<bigint, TypeId>
|
|
|
53
53
|
* @category constructors
|
|
54
54
|
* @since 4.0.0
|
|
55
55
|
*/
|
|
56
|
-
export const Snowflake = (input: string | bigint): Snowflake =>
|
|
57
|
-
typeof input === "
|
|
56
|
+
export const Snowflake = (input: string | number | bigint): Snowflake =>
|
|
57
|
+
typeof input === "bigint" ? input as Snowflake : BigInt(input) as Snowflake
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Namespace containing support types for snowflake parts and generators.
|
|
@@ -18,7 +18,6 @@ import * as Schema from "../../../Schema.ts"
|
|
|
18
18
|
import * as SchemaIssue from "../../../SchemaIssue.ts"
|
|
19
19
|
import * as Scope from "../../../Scope.ts"
|
|
20
20
|
import type * as Rpc from "../../rpc/Rpc.ts"
|
|
21
|
-
import { RequestId } from "../../rpc/RpcMessage.ts"
|
|
22
21
|
import * as RpcServer from "../../rpc/RpcServer.ts"
|
|
23
22
|
import { AlreadyProcessingMessage, EntityNotAssignedToRunner, MailboxFull, MalformedMessage } from "../ClusterError.ts"
|
|
24
23
|
import * as ClusterMetrics from "../ClusterMetrics.ts"
|
|
@@ -67,7 +66,7 @@ export interface EntityManager {
|
|
|
67
66
|
export type EntityState = {
|
|
68
67
|
readonly address: EntityAddress
|
|
69
68
|
readonly scope: Scope.Scope
|
|
70
|
-
readonly activeRequests: Map<
|
|
69
|
+
readonly activeRequests: Map<Snowflake.Snowflake, {
|
|
71
70
|
readonly rpc: Rpc.AnyWithProps
|
|
72
71
|
readonly message: Message.IncomingRequestLocal<any>
|
|
73
72
|
sentReply: boolean
|
|
@@ -145,7 +144,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
145
144
|
)
|
|
146
145
|
|
|
147
146
|
const activeRequests: EntityState["activeRequests"] = new Map()
|
|
148
|
-
let defectRequestIds = new Set<
|
|
147
|
+
let defectRequestIds = new Set<Snowflake.Snowflake>()
|
|
149
148
|
let isRestartingDueToDefect = false
|
|
150
149
|
|
|
151
150
|
// the server is stored in a ref, so if there is a defect, we can
|
|
@@ -184,7 +183,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
184
183
|
onFromServer(response): Effect.Effect<void> {
|
|
185
184
|
switch (response._tag) {
|
|
186
185
|
case "Exit": {
|
|
187
|
-
const request = activeRequests.get(response.requestId)
|
|
186
|
+
const request = activeRequests.get(Snowflake.Snowflake(response.requestId))
|
|
188
187
|
if (!request) return Effect.void
|
|
189
188
|
|
|
190
189
|
request.sentReply = true
|
|
@@ -192,7 +191,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
192
191
|
if (
|
|
193
192
|
isShuttingDown &&
|
|
194
193
|
Exit.hasInterrupts(response.exit) &&
|
|
195
|
-
defectRequestIds.has(response.requestId)
|
|
194
|
+
defectRequestIds.has(Snowflake.Snowflake(response.requestId))
|
|
196
195
|
) {
|
|
197
196
|
return Effect.void
|
|
198
197
|
}
|
|
@@ -210,7 +209,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
210
209
|
if (!isShuttingDown) {
|
|
211
210
|
return server.write(0, {
|
|
212
211
|
...request.message.envelope,
|
|
213
|
-
id:
|
|
212
|
+
id: request.message.envelope.requestId as any,
|
|
214
213
|
tag: request.message.envelope.tag as any,
|
|
215
214
|
payload: new Request({
|
|
216
215
|
...request.message.envelope,
|
|
@@ -220,7 +219,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
220
219
|
Effect.forkIn(scope)
|
|
221
220
|
)
|
|
222
221
|
}
|
|
223
|
-
activeRequests.delete(response.requestId)
|
|
222
|
+
activeRequests.delete(Snowflake.Snowflake(response.requestId))
|
|
224
223
|
return options.storage.unregisterReplyHandler(request.message.envelope.requestId)
|
|
225
224
|
}
|
|
226
225
|
return retryRespond(
|
|
@@ -237,7 +236,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
237
236
|
).pipe(
|
|
238
237
|
Effect.flatMap(() => {
|
|
239
238
|
processedRequestIds.add(request.message.envelope.requestId)
|
|
240
|
-
activeRequests.delete(response.requestId)
|
|
239
|
+
activeRequests.delete(Snowflake.Snowflake(response.requestId))
|
|
241
240
|
|
|
242
241
|
// ensure that the reaper does not remove the entity as we haven't
|
|
243
242
|
// been "idle" yet
|
|
@@ -251,7 +250,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
251
250
|
)
|
|
252
251
|
}
|
|
253
252
|
case "Chunk": {
|
|
254
|
-
const request = activeRequests.get(response.requestId)
|
|
253
|
+
const request = activeRequests.get(Snowflake.Snowflake(response.requestId))
|
|
255
254
|
if (!request) return Effect.void
|
|
256
255
|
const sequence = request.sequence
|
|
257
256
|
request.sequence++
|
|
@@ -299,7 +298,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
299
298
|
const { lastSentChunk, message } = request
|
|
300
299
|
yield* server.write(0, {
|
|
301
300
|
...message.envelope,
|
|
302
|
-
id:
|
|
301
|
+
id: message.envelope.requestId as any,
|
|
303
302
|
tag: message.envelope.tag as any,
|
|
304
303
|
payload: new Request({
|
|
305
304
|
...message.envelope,
|
|
@@ -475,7 +474,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
475
474
|
server.activeRequests.set(message.envelope.requestId, entry)
|
|
476
475
|
let write = server.write(0, {
|
|
477
476
|
...message.envelope,
|
|
478
|
-
id:
|
|
477
|
+
id: message.envelope.requestId as any,
|
|
479
478
|
payload: new Request({
|
|
480
479
|
...message.envelope,
|
|
481
480
|
lastSentChunk: Option.filter(
|
|
@@ -503,10 +502,10 @@ export const make = Effect.fnUntraced(function*<
|
|
|
503
502
|
return server.write(
|
|
504
503
|
0,
|
|
505
504
|
message.envelope._tag === "AckChunk"
|
|
506
|
-
? { _tag: "Ack", requestId:
|
|
505
|
+
? { _tag: "Ack", requestId: message.envelope.requestId as any }
|
|
507
506
|
: {
|
|
508
507
|
_tag: "Interrupt",
|
|
509
|
-
requestId:
|
|
508
|
+
requestId: message.envelope.requestId as any,
|
|
510
509
|
interruptors: []
|
|
511
510
|
}
|
|
512
511
|
)
|
|
@@ -611,9 +610,10 @@ export const make = Effect.fnUntraced(function*<
|
|
|
611
610
|
})
|
|
612
611
|
})
|
|
613
612
|
|
|
614
|
-
const defaultRetryPolicy = Schedule.
|
|
615
|
-
Schedule.
|
|
616
|
-
)
|
|
613
|
+
const defaultRetryPolicy = Schedule.min([
|
|
614
|
+
Schedule.exponential(500, 1.5),
|
|
615
|
+
Schedule.spaced("10 seconds")
|
|
616
|
+
])
|
|
617
617
|
|
|
618
618
|
const makeMessageDecode = <Type extends string, Rpcs extends Rpc.Any>(
|
|
619
619
|
entity: Entity<Type, Rpcs>,
|
|
@@ -854,9 +854,10 @@ const make = Effect.gen(function*() {
|
|
|
854
854
|
Effect.scoped,
|
|
855
855
|
Effect.catchCause(Effect.logError),
|
|
856
856
|
Effect.repeat(
|
|
857
|
-
Schedule.
|
|
858
|
-
Schedule.
|
|
859
|
-
|
|
857
|
+
Schedule.min([
|
|
858
|
+
Schedule.exponential(200, 1.5),
|
|
859
|
+
Schedule.spaced({ seconds: 10 })
|
|
860
|
+
])
|
|
860
861
|
),
|
|
861
862
|
Effect.annotateLogs({
|
|
862
863
|
service: "EventLog",
|
|
@@ -25,7 +25,7 @@ import type { HttpBody } from "../http/HttpBody.ts"
|
|
|
25
25
|
|
|
26
26
|
const policy = Schedule.forever.pipe(
|
|
27
27
|
Schedule.passthrough,
|
|
28
|
-
Schedule.addDelay((error) => {
|
|
28
|
+
Schedule.addDelay(({ output: error }) => {
|
|
29
29
|
if (
|
|
30
30
|
HttpClientError.isHttpClientError(error)
|
|
31
31
|
&& error.reason._tag === "StatusCodeError"
|
|
@@ -96,8 +96,8 @@ export interface AtomRegistry {
|
|
|
96
96
|
export interface Node<A> {
|
|
97
97
|
readonly atom: Atom.Atom<A>
|
|
98
98
|
readonly value: () => A
|
|
99
|
-
parents:
|
|
100
|
-
children:
|
|
99
|
+
parents: Set<Node<any>>
|
|
100
|
+
children: Set<Node<any>>
|
|
101
101
|
listeners: Set<() => void>
|
|
102
102
|
currentState(): "uninitialized" | "stale" | "valid" | "removed"
|
|
103
103
|
}
|
|
@@ -713,10 +713,10 @@ class NodeImpl<A> {
|
|
|
713
713
|
writeContext: WriteContextImpl<A>
|
|
714
714
|
preserveInitialValueOnBuild = false
|
|
715
715
|
|
|
716
|
-
parents
|
|
717
|
-
previousParents:
|
|
718
|
-
children
|
|
719
|
-
listeners
|
|
716
|
+
parents = new Set<NodeImpl<any>>()
|
|
717
|
+
previousParents: Set<NodeImpl<any>> | undefined
|
|
718
|
+
children = new Set<NodeImpl<any>>()
|
|
719
|
+
listeners = new Set<() => void>()
|
|
720
720
|
skipInvalidation = false
|
|
721
721
|
|
|
722
722
|
currentState() {
|
|
@@ -733,7 +733,7 @@ class NodeImpl<A> {
|
|
|
733
733
|
}
|
|
734
734
|
|
|
735
735
|
get canBeRemoved(): boolean {
|
|
736
|
-
return !this.atom.keepAlive && this.listeners.size === 0 && this.children.
|
|
736
|
+
return !this.atom.keepAlive && this.listeners.size === 0 && this.children.size === 0 && this.state !== 0
|
|
737
737
|
}
|
|
738
738
|
|
|
739
739
|
_value: A = undefined as any
|
|
@@ -753,10 +753,10 @@ class NodeImpl<A> {
|
|
|
753
753
|
if (this.previousParents) {
|
|
754
754
|
const parents = this.previousParents
|
|
755
755
|
this.previousParents = undefined
|
|
756
|
-
for (
|
|
757
|
-
|
|
758
|
-
if (
|
|
759
|
-
this.registry.scheduleNodeRemoval(
|
|
756
|
+
for (const parent of parents) {
|
|
757
|
+
parent.removeChild(this)
|
|
758
|
+
if (parent.canBeRemoved) {
|
|
759
|
+
this.registry.scheduleNodeRemoval(parent)
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
762
|
}
|
|
@@ -826,19 +826,16 @@ class NodeImpl<A> {
|
|
|
826
826
|
}
|
|
827
827
|
|
|
828
828
|
addParent(parent: NodeImpl<any>): void {
|
|
829
|
-
this.parents.
|
|
829
|
+
this.parents.add(parent)
|
|
830
830
|
if (this.previousParents !== undefined) {
|
|
831
|
-
|
|
832
|
-
if (
|
|
833
|
-
this.previousParents
|
|
834
|
-
if (this.previousParents.pop() === undefined) {
|
|
835
|
-
this.previousParents = undefined
|
|
836
|
-
}
|
|
831
|
+
this.previousParents.delete(parent)
|
|
832
|
+
if (this.previousParents.size === 0) {
|
|
833
|
+
this.previousParents = undefined
|
|
837
834
|
}
|
|
838
835
|
}
|
|
839
836
|
|
|
840
|
-
if (parent.children.
|
|
841
|
-
parent.children.
|
|
837
|
+
if (!parent.children.has(this)) {
|
|
838
|
+
parent.children.add(this)
|
|
842
839
|
if (parent.skipInvalidation) {
|
|
843
840
|
parent.skipInvalidation = false
|
|
844
841
|
}
|
|
@@ -846,11 +843,7 @@ class NodeImpl<A> {
|
|
|
846
843
|
}
|
|
847
844
|
|
|
848
845
|
removeChild(child: NodeImpl<any>): void {
|
|
849
|
-
|
|
850
|
-
if (index !== -1) {
|
|
851
|
-
this.children[index] = this.children[this.children.length - 1]
|
|
852
|
-
this.children.pop()
|
|
853
|
-
}
|
|
846
|
+
this.children.delete(child)
|
|
854
847
|
}
|
|
855
848
|
|
|
856
849
|
invalidate(): void {
|
|
@@ -870,14 +863,14 @@ class NodeImpl<A> {
|
|
|
870
863
|
}
|
|
871
864
|
|
|
872
865
|
invalidateChildren(): void {
|
|
873
|
-
if (this.children.
|
|
866
|
+
if (this.children.size === 0) {
|
|
874
867
|
return
|
|
875
868
|
}
|
|
876
869
|
|
|
877
870
|
const children = this.children
|
|
878
|
-
this.children =
|
|
879
|
-
for (
|
|
880
|
-
|
|
871
|
+
this.children = new Set()
|
|
872
|
+
for (const child of children) {
|
|
873
|
+
child.invalidate()
|
|
881
874
|
}
|
|
882
875
|
}
|
|
883
876
|
|
|
@@ -895,9 +888,9 @@ class NodeImpl<A> {
|
|
|
895
888
|
this.lifetime = undefined
|
|
896
889
|
}
|
|
897
890
|
|
|
898
|
-
if (this.parents.
|
|
891
|
+
if (this.parents.size !== 0) {
|
|
899
892
|
this.previousParents = this.parents
|
|
900
|
-
this.parents =
|
|
893
|
+
this.parents = new Set()
|
|
901
894
|
}
|
|
902
895
|
}
|
|
903
896
|
|
|
@@ -917,10 +910,10 @@ class NodeImpl<A> {
|
|
|
917
910
|
|
|
918
911
|
const parents = this.previousParents
|
|
919
912
|
this.previousParents = undefined
|
|
920
|
-
for (
|
|
921
|
-
|
|
922
|
-
if (
|
|
923
|
-
this.registry.removeNode(
|
|
913
|
+
for (const parent of parents) {
|
|
914
|
+
parent.removeChild(this)
|
|
915
|
+
if (parent.canBeRemoved) {
|
|
916
|
+
this.registry.removeNode(parent)
|
|
924
917
|
}
|
|
925
918
|
}
|
|
926
919
|
}
|
|
@@ -931,19 +924,18 @@ class NodeImpl<A> {
|
|
|
931
924
|
}
|
|
932
925
|
}
|
|
933
926
|
|
|
934
|
-
function childrenAreActive(children:
|
|
935
|
-
if (children.
|
|
927
|
+
function childrenAreActive(children: Set<NodeImpl<any>>): boolean {
|
|
928
|
+
if (children.size === 0) {
|
|
936
929
|
return false
|
|
937
930
|
}
|
|
938
|
-
let current:
|
|
939
|
-
let stack: Array<
|
|
931
|
+
let current: Set<NodeImpl<any>> | undefined = children
|
|
932
|
+
let stack: Array<Set<NodeImpl<any>>> | undefined
|
|
940
933
|
let stackIndex = 0
|
|
941
934
|
while (current !== undefined) {
|
|
942
|
-
for (
|
|
943
|
-
const child = current[i]
|
|
935
|
+
for (const child of current) {
|
|
944
936
|
if (!child.atom.lazy || child.listeners.size > 0) {
|
|
945
937
|
return true
|
|
946
|
-
} else if (child.children.
|
|
938
|
+
} else if (child.children.size > 0) {
|
|
947
939
|
if (stack === undefined) {
|
|
948
940
|
stack = [child.children]
|
|
949
941
|
} else {
|
|
@@ -1233,8 +1225,7 @@ function batchRebuildNode(node: NodeImpl<any>) {
|
|
|
1233
1225
|
return
|
|
1234
1226
|
}
|
|
1235
1227
|
|
|
1236
|
-
for (
|
|
1237
|
-
const parent = node.parents[i]
|
|
1228
|
+
for (const parent of node.parents) {
|
|
1238
1229
|
if (parent.state !== NodeState.valid) {
|
|
1239
1230
|
batchRebuildNode(parent)
|
|
1240
1231
|
}
|
|
@@ -204,7 +204,7 @@ export declare namespace RpcClient {
|
|
|
204
204
|
*/
|
|
205
205
|
export type FromGroup<Group, E = never> = RpcClient<RpcGroup.Rpcs<Group>, E>
|
|
206
206
|
|
|
207
|
-
let requestIdCounter =
|
|
207
|
+
let requestIdCounter = 0
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Creates an RPC client for an already-decoded message channel, returning the
|
|
@@ -681,7 +681,7 @@ export const make: <Rpcs extends Rpc.Any, const Flatten extends boolean = false>
|
|
|
681
681
|
Effect.flatMap((payload) =>
|
|
682
682
|
send(clientId, {
|
|
683
683
|
...message,
|
|
684
|
-
id:
|
|
684
|
+
id: message.id,
|
|
685
685
|
payload,
|
|
686
686
|
headers: Object.entries(message.headers)
|
|
687
687
|
}, collector && collector.readUnsafe())
|
|
@@ -693,7 +693,7 @@ export const make: <Rpcs extends Rpc.Any, const Flatten extends boolean = false>
|
|
|
693
693
|
if (!entry) return Effect.void
|
|
694
694
|
return send(clientId, {
|
|
695
695
|
_tag: "Ack",
|
|
696
|
-
requestId:
|
|
696
|
+
requestId: message.requestId
|
|
697
697
|
}) as Effect.Effect<void, RpcClientError>
|
|
698
698
|
}
|
|
699
699
|
case "Interrupt": {
|
|
@@ -702,7 +702,7 @@ export const make: <Rpcs extends Rpc.Any, const Flatten extends boolean = false>
|
|
|
702
702
|
entries.delete(message.requestId)
|
|
703
703
|
return send(clientId, {
|
|
704
704
|
_tag: "Interrupt",
|
|
705
|
-
requestId:
|
|
705
|
+
requestId: message.requestId
|
|
706
706
|
}) as Effect.Effect<void, RpcClientError>
|
|
707
707
|
}
|
|
708
708
|
case "Eof": {
|
|
@@ -1030,7 +1030,7 @@ export const makeProtocolSocket = (options?: {
|
|
|
1030
1030
|
const socket = yield* Socket.Socket
|
|
1031
1031
|
const serialization = yield* RpcSerialization.RpcSerialization
|
|
1032
1032
|
const hooks = yield* Effect.serviceOption(ConnectionHooks)
|
|
1033
|
-
const requestClientMap = new Map<string, number>()
|
|
1033
|
+
const requestClientMap = new Map<string | number, number>()
|
|
1034
1034
|
|
|
1035
1035
|
const write = yield* socket.writer
|
|
1036
1036
|
|
|
@@ -1150,9 +1150,10 @@ export const makeProtocolSocket = (options?: {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
}))
|
|
1152
1152
|
|
|
1153
|
-
const defaultRetryPolicy = Schedule.
|
|
1154
|
-
Schedule.
|
|
1155
|
-
)
|
|
1153
|
+
const defaultRetryPolicy = Schedule.min([
|
|
1154
|
+
Schedule.exponential(500, 1.5),
|
|
1155
|
+
Schedule.spaced(5000)
|
|
1156
|
+
])
|
|
1156
1157
|
|
|
1157
1158
|
const makePinger = Effect.fnUntraced(function*<A, E, R>(writePing: Effect.Effect<A, E, R>) {
|
|
1158
1159
|
let recievedPong = true
|
|
@@ -1224,7 +1225,7 @@ export const makeProtocolWorker = (
|
|
|
1224
1225
|
const initialMessage = yield* Effect.serviceOption(RpcWorker.InitialMessage)
|
|
1225
1226
|
const hooks = yield* Effect.serviceOption(ConnectionHooks)
|
|
1226
1227
|
|
|
1227
|
-
const entries = new Map<string, {
|
|
1228
|
+
const entries = new Map<string | number, {
|
|
1228
1229
|
readonly clientId: number
|
|
1229
1230
|
readonly worker: Worker.Worker<FromServerEncoded, FromClientEncoded | RpcWorker.InitialMessage.Encoded>
|
|
1230
1231
|
readonly latch: Latch.Latch
|