actor-ts 0.9.0
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/CHANGELOG.md +885 -0
- package/LICENSE +201 -0
- package/README.md +269 -0
- package/dist/Actor.d.ts +49 -0
- package/dist/Actor.d.ts.map +1 -0
- package/dist/Actor.js +45 -0
- package/dist/Actor.js.map +1 -0
- package/dist/ActorContext.d.ts +171 -0
- package/dist/ActorContext.d.ts.map +1 -0
- package/dist/ActorContext.js +13 -0
- package/dist/ActorContext.js.map +1 -0
- package/dist/ActorPath.d.ts +23 -0
- package/dist/ActorPath.d.ts.map +1 -0
- package/dist/ActorPath.js +56 -0
- package/dist/ActorPath.js.map +1 -0
- package/dist/ActorRef.d.ts +54 -0
- package/dist/ActorRef.d.ts.map +1 -0
- package/dist/ActorRef.js +105 -0
- package/dist/ActorRef.js.map +1 -0
- package/dist/ActorSelection.d.ts +48 -0
- package/dist/ActorSelection.d.ts.map +1 -0
- package/dist/ActorSelection.js +84 -0
- package/dist/ActorSelection.js.map +1 -0
- package/dist/ActorSystem.d.ts +152 -0
- package/dist/ActorSystem.d.ts.map +1 -0
- package/dist/ActorSystem.js +248 -0
- package/dist/ActorSystem.js.map +1 -0
- package/dist/CoordinatedShutdown.d.ts +112 -0
- package/dist/CoordinatedShutdown.d.ts.map +1 -0
- package/dist/CoordinatedShutdown.js +252 -0
- package/dist/CoordinatedShutdown.js.map +1 -0
- package/dist/Dispatcher.d.ts +47 -0
- package/dist/Dispatcher.d.ts.map +1 -0
- package/dist/Dispatcher.js +90 -0
- package/dist/Dispatcher.js.map +1 -0
- package/dist/EventStream.d.ts +58 -0
- package/dist/EventStream.d.ts.map +1 -0
- package/dist/EventStream.js +74 -0
- package/dist/EventStream.js.map +1 -0
- package/dist/Extension.d.ts +45 -0
- package/dist/Extension.d.ts.map +1 -0
- package/dist/Extension.js +51 -0
- package/dist/Extension.js.map +1 -0
- package/dist/LogContext.d.ts +44 -0
- package/dist/LogContext.d.ts.map +1 -0
- package/dist/LogContext.js +87 -0
- package/dist/LogContext.js.map +1 -0
- package/dist/Logger.d.ts +57 -0
- package/dist/Logger.d.ts.map +1 -0
- package/dist/Logger.js +81 -0
- package/dist/Logger.js.map +1 -0
- package/dist/Props.d.ts +32 -0
- package/dist/Props.d.ts.map +1 -0
- package/dist/Props.js +27 -0
- package/dist/Props.js.map +1 -0
- package/dist/Router.d.ts +32 -0
- package/dist/Router.d.ts.map +1 -0
- package/dist/Router.js +78 -0
- package/dist/Router.js.map +1 -0
- package/dist/Scheduler.d.ts +25 -0
- package/dist/Scheduler.d.ts.map +1 -0
- package/dist/Scheduler.js +112 -0
- package/dist/Scheduler.js.map +1 -0
- package/dist/Supervision.d.ts +66 -0
- package/dist/Supervision.d.ts.map +1 -0
- package/dist/Supervision.js +75 -0
- package/dist/Supervision.js.map +1 -0
- package/dist/SystemMessages.d.ts +56 -0
- package/dist/SystemMessages.d.ts.map +1 -0
- package/dist/SystemMessages.js +71 -0
- package/dist/SystemMessages.js.map +1 -0
- package/dist/cache/Cache.d.ts +75 -0
- package/dist/cache/Cache.d.ts.map +1 -0
- package/dist/cache/Cache.js +10 -0
- package/dist/cache/Cache.js.map +1 -0
- package/dist/cache/CacheExtension.d.ts +44 -0
- package/dist/cache/CacheExtension.d.ts.map +1 -0
- package/dist/cache/CacheExtension.js +77 -0
- package/dist/cache/CacheExtension.js.map +1 -0
- package/dist/cache/InMemoryCache.d.ts +16 -0
- package/dist/cache/InMemoryCache.d.ts.map +1 -0
- package/dist/cache/InMemoryCache.js +86 -0
- package/dist/cache/InMemoryCache.js.map +1 -0
- package/dist/cache/MemcachedCache.d.ts +71 -0
- package/dist/cache/MemcachedCache.d.ts.map +1 -0
- package/dist/cache/MemcachedCache.js +243 -0
- package/dist/cache/MemcachedCache.js.map +1 -0
- package/dist/cache/RedisCache.d.ts +80 -0
- package/dist/cache/RedisCache.d.ts.map +1 -0
- package/dist/cache/RedisCache.js +194 -0
- package/dist/cache/RedisCache.js.map +1 -0
- package/dist/cache/index.d.ts +9 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +6 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cluster/Cluster.d.ts +251 -0
- package/dist/cluster/Cluster.d.ts.map +1 -0
- package/dist/cluster/Cluster.js +837 -0
- package/dist/cluster/Cluster.js.map +1 -0
- package/dist/cluster/ClusterBootstrap.d.ts +107 -0
- package/dist/cluster/ClusterBootstrap.d.ts.map +1 -0
- package/dist/cluster/ClusterBootstrap.js +184 -0
- package/dist/cluster/ClusterBootstrap.js.map +1 -0
- package/dist/cluster/ClusterClient.d.ts +112 -0
- package/dist/cluster/ClusterClient.d.ts.map +1 -0
- package/dist/cluster/ClusterClient.js +280 -0
- package/dist/cluster/ClusterClient.js.map +1 -0
- package/dist/cluster/ClusterClientReceptionist.d.ts +85 -0
- package/dist/cluster/ClusterClientReceptionist.d.ts.map +1 -0
- package/dist/cluster/ClusterClientReceptionist.js +159 -0
- package/dist/cluster/ClusterClientReceptionist.js.map +1 -0
- package/dist/cluster/ClusterEvents.d.ts +99 -0
- package/dist/cluster/ClusterEvents.d.ts.map +1 -0
- package/dist/cluster/ClusterEvents.js +124 -0
- package/dist/cluster/ClusterEvents.js.map +1 -0
- package/dist/cluster/FailureDetector.d.ts +32 -0
- package/dist/cluster/FailureDetector.d.ts.map +1 -0
- package/dist/cluster/FailureDetector.js +50 -0
- package/dist/cluster/FailureDetector.js.map +1 -0
- package/dist/cluster/Member.d.ts +38 -0
- package/dist/cluster/Member.d.ts.map +1 -0
- package/dist/cluster/Member.js +69 -0
- package/dist/cluster/Member.js.map +1 -0
- package/dist/cluster/NodeAddress.d.ts +24 -0
- package/dist/cluster/NodeAddress.d.ts.map +1 -0
- package/dist/cluster/NodeAddress.js +44 -0
- package/dist/cluster/NodeAddress.js.map +1 -0
- package/dist/cluster/PhiAccrualFailureDetector.d.ts +49 -0
- package/dist/cluster/PhiAccrualFailureDetector.d.ts.map +1 -0
- package/dist/cluster/PhiAccrualFailureDetector.js +139 -0
- package/dist/cluster/PhiAccrualFailureDetector.js.map +1 -0
- package/dist/cluster/Protocol.d.ts +151 -0
- package/dist/cluster/Protocol.d.ts.map +1 -0
- package/dist/cluster/Protocol.js +90 -0
- package/dist/cluster/Protocol.js.map +1 -0
- package/dist/cluster/RefCodec.d.ts +40 -0
- package/dist/cluster/RefCodec.d.ts.map +1 -0
- package/dist/cluster/RefCodec.js +134 -0
- package/dist/cluster/RefCodec.js.map +1 -0
- package/dist/cluster/RemoteActorRef.d.ts +22 -0
- package/dist/cluster/RemoteActorRef.d.ts.map +1 -0
- package/dist/cluster/RemoteActorRef.js +48 -0
- package/dist/cluster/RemoteActorRef.js.map +1 -0
- package/dist/cluster/Transport.d.ts +96 -0
- package/dist/cluster/Transport.d.ts.map +1 -0
- package/dist/cluster/Transport.js +299 -0
- package/dist/cluster/Transport.js.map +1 -0
- package/dist/cluster/downing/DowningProvider.d.ts +32 -0
- package/dist/cluster/downing/DowningProvider.d.ts.map +1 -0
- package/dist/cluster/downing/DowningProvider.js +5 -0
- package/dist/cluster/downing/DowningProvider.js.map +1 -0
- package/dist/cluster/downing/KeepMajority.d.ts +21 -0
- package/dist/cluster/downing/KeepMajority.d.ts.map +1 -0
- package/dist/cluster/downing/KeepMajority.js +39 -0
- package/dist/cluster/downing/KeepMajority.js.map +1 -0
- package/dist/cluster/downing/KeepOldest.d.ts +23 -0
- package/dist/cluster/downing/KeepOldest.d.ts.map +1 -0
- package/dist/cluster/downing/KeepOldest.js +37 -0
- package/dist/cluster/downing/KeepOldest.js.map +1 -0
- package/dist/cluster/downing/KeepReferee.d.ts +23 -0
- package/dist/cluster/downing/KeepReferee.d.ts.map +1 -0
- package/dist/cluster/downing/KeepReferee.js +35 -0
- package/dist/cluster/downing/KeepReferee.js.map +1 -0
- package/dist/cluster/downing/LeaseMajority.d.ts +70 -0
- package/dist/cluster/downing/LeaseMajority.d.ts.map +1 -0
- package/dist/cluster/downing/LeaseMajority.js +129 -0
- package/dist/cluster/downing/LeaseMajority.js.map +1 -0
- package/dist/cluster/downing/StaticQuorum.d.ts +21 -0
- package/dist/cluster/downing/StaticQuorum.d.ts.map +1 -0
- package/dist/cluster/downing/StaticQuorum.js +30 -0
- package/dist/cluster/downing/StaticQuorum.js.map +1 -0
- package/dist/cluster/downing/index.d.ts +13 -0
- package/dist/cluster/downing/index.d.ts.map +1 -0
- package/dist/cluster/downing/index.js +7 -0
- package/dist/cluster/downing/index.js.map +1 -0
- package/dist/cluster/index.d.ts +49 -0
- package/dist/cluster/index.d.ts.map +1 -0
- package/dist/cluster/index.js +33 -0
- package/dist/cluster/index.js.map +1 -0
- package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts +30 -0
- package/dist/cluster/pubsub/DistributedPubSubExtension.d.ts.map +1 -0
- package/dist/cluster/pubsub/DistributedPubSubExtension.js +42 -0
- package/dist/cluster/pubsub/DistributedPubSubExtension.js.map +1 -0
- package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts +56 -0
- package/dist/cluster/pubsub/DistributedPubSubMediator.d.ts.map +1 -0
- package/dist/cluster/pubsub/DistributedPubSubMediator.js +240 -0
- package/dist/cluster/pubsub/DistributedPubSubMediator.js.map +1 -0
- package/dist/cluster/pubsub/Messages.d.ts +75 -0
- package/dist/cluster/pubsub/Messages.d.ts.map +1 -0
- package/dist/cluster/pubsub/Messages.js +66 -0
- package/dist/cluster/pubsub/Messages.js.map +1 -0
- package/dist/cluster/pubsub/index.d.ts +5 -0
- package/dist/cluster/pubsub/index.d.ts.map +1 -0
- package/dist/cluster/pubsub/index.js +4 -0
- package/dist/cluster/pubsub/index.js.map +1 -0
- package/dist/cluster/router/ClusterRouter.d.ts +87 -0
- package/dist/cluster/router/ClusterRouter.d.ts.map +1 -0
- package/dist/cluster/router/ClusterRouter.js +116 -0
- package/dist/cluster/router/ClusterRouter.js.map +1 -0
- package/dist/cluster/router/ConsistentHashing.d.ts +27 -0
- package/dist/cluster/router/ConsistentHashing.d.ts.map +1 -0
- package/dist/cluster/router/ConsistentHashing.js +69 -0
- package/dist/cluster/router/ConsistentHashing.js.map +1 -0
- package/dist/cluster/router/index.d.ts +4 -0
- package/dist/cluster/router/index.d.ts.map +1 -0
- package/dist/cluster/router/index.js +3 -0
- package/dist/cluster/router/index.js.map +1 -0
- package/dist/cluster/sharding/AllocationStrategy.d.ts +45 -0
- package/dist/cluster/sharding/AllocationStrategy.d.ts.map +1 -0
- package/dist/cluster/sharding/AllocationStrategy.js +95 -0
- package/dist/cluster/sharding/AllocationStrategy.js.map +1 -0
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts +77 -0
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.d.ts.map +1 -0
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.js +98 -0
- package/dist/cluster/sharding/CassandraRememberEntitiesStore.js.map +1 -0
- package/dist/cluster/sharding/ClusterSharding.d.ts +116 -0
- package/dist/cluster/sharding/ClusterSharding.d.ts.map +1 -0
- package/dist/cluster/sharding/ClusterSharding.js +133 -0
- package/dist/cluster/sharding/ClusterSharding.js.map +1 -0
- package/dist/cluster/sharding/CoordinatorState.d.ts +83 -0
- package/dist/cluster/sharding/CoordinatorState.d.ts.map +1 -0
- package/dist/cluster/sharding/CoordinatorState.js +46 -0
- package/dist/cluster/sharding/CoordinatorState.js.map +1 -0
- package/dist/cluster/sharding/Passivate.d.ts +23 -0
- package/dist/cluster/sharding/Passivate.d.ts.map +1 -0
- package/dist/cluster/sharding/Passivate.js +25 -0
- package/dist/cluster/sharding/Passivate.js.map +1 -0
- package/dist/cluster/sharding/RememberEntitiesStore.d.ts +60 -0
- package/dist/cluster/sharding/RememberEntitiesStore.d.ts.map +1 -0
- package/dist/cluster/sharding/RememberEntitiesStore.js +35 -0
- package/dist/cluster/sharding/RememberEntitiesStore.js.map +1 -0
- package/dist/cluster/sharding/ShardAllocator.d.ts +23 -0
- package/dist/cluster/sharding/ShardAllocator.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardAllocator.js +54 -0
- package/dist/cluster/sharding/ShardAllocator.js.map +1 -0
- package/dist/cluster/sharding/ShardCoordinator.d.ts +218 -0
- package/dist/cluster/sharding/ShardCoordinator.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardCoordinator.js +719 -0
- package/dist/cluster/sharding/ShardCoordinator.js.map +1 -0
- package/dist/cluster/sharding/ShardRegion.d.ts +156 -0
- package/dist/cluster/sharding/ShardRegion.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardRegion.js +526 -0
- package/dist/cluster/sharding/ShardRegion.js.map +1 -0
- package/dist/cluster/sharding/ShardedDaemonProcess.d.ts +64 -0
- package/dist/cluster/sharding/ShardedDaemonProcess.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardedDaemonProcess.js +107 -0
- package/dist/cluster/sharding/ShardedDaemonProcess.js.map +1 -0
- package/dist/cluster/sharding/ShardingProtocol.d.ts +92 -0
- package/dist/cluster/sharding/ShardingProtocol.d.ts.map +1 -0
- package/dist/cluster/sharding/ShardingProtocol.js +7 -0
- package/dist/cluster/sharding/ShardingProtocol.js.map +1 -0
- package/dist/cluster/singleton/ClusterSingleton.d.ts +59 -0
- package/dist/cluster/singleton/ClusterSingleton.d.ts.map +1 -0
- package/dist/cluster/singleton/ClusterSingleton.js +63 -0
- package/dist/cluster/singleton/ClusterSingleton.js.map +1 -0
- package/dist/cluster/singleton/ClusterSingletonManager.d.ts +116 -0
- package/dist/cluster/singleton/ClusterSingletonManager.d.ts.map +1 -0
- package/dist/cluster/singleton/ClusterSingletonManager.js +300 -0
- package/dist/cluster/singleton/ClusterSingletonManager.js.map +1 -0
- package/dist/cluster/singleton/ClusterSingletonProxy.d.ts +32 -0
- package/dist/cluster/singleton/ClusterSingletonProxy.d.ts.map +1 -0
- package/dist/cluster/singleton/ClusterSingletonProxy.js +81 -0
- package/dist/cluster/singleton/ClusterSingletonProxy.js.map +1 -0
- package/dist/cluster/singleton/index.d.ts +6 -0
- package/dist/cluster/singleton/index.d.ts.map +1 -0
- package/dist/cluster/singleton/index.js +4 -0
- package/dist/cluster/singleton/index.js.map +1 -0
- package/dist/cluster/transports/MessageChannelTransport.d.ts +52 -0
- package/dist/cluster/transports/MessageChannelTransport.d.ts.map +1 -0
- package/dist/cluster/transports/MessageChannelTransport.js +59 -0
- package/dist/cluster/transports/MessageChannelTransport.js.map +1 -0
- package/dist/config/Config.d.ts +73 -0
- package/dist/config/Config.d.ts.map +1 -0
- package/dist/config/Config.js +240 -0
- package/dist/config/Config.js.map +1 -0
- package/dist/config/ConfigKeys.d.ts +94 -0
- package/dist/config/ConfigKeys.d.ts.map +1 -0
- package/dist/config/ConfigKeys.js +94 -0
- package/dist/config/ConfigKeys.js.map +1 -0
- package/dist/config/Duration.d.ts +2 -0
- package/dist/config/Duration.d.ts.map +1 -0
- package/dist/config/Duration.js +70 -0
- package/dist/config/Duration.js.map +1 -0
- package/dist/config/HoconParser.d.ts +19 -0
- package/dist/config/HoconParser.d.ts.map +1 -0
- package/dist/config/HoconParser.js +473 -0
- package/dist/config/HoconParser.js.map +1 -0
- package/dist/config/Size.d.ts +2 -0
- package/dist/config/Size.d.ts.map +1 -0
- package/dist/config/Size.js +53 -0
- package/dist/config/Size.js.map +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/reference.d.ts +11 -0
- package/dist/config/reference.d.ts.map +1 -0
- package/dist/config/reference.js +86 -0
- package/dist/config/reference.js.map +1 -0
- package/dist/coordination/Lease.d.ts +40 -0
- package/dist/coordination/Lease.d.ts.map +1 -0
- package/dist/coordination/Lease.js +2 -0
- package/dist/coordination/Lease.js.map +1 -0
- package/dist/coordination/index.d.ts +5 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +3 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/leases/InMemoryLease.d.ts +40 -0
- package/dist/coordination/leases/InMemoryLease.d.ts.map +1 -0
- package/dist/coordination/leases/InMemoryLease.js +109 -0
- package/dist/coordination/leases/InMemoryLease.js.map +1 -0
- package/dist/coordination/leases/KubernetesLease.d.ts +78 -0
- package/dist/coordination/leases/KubernetesLease.d.ts.map +1 -0
- package/dist/coordination/leases/KubernetesLease.js +244 -0
- package/dist/coordination/leases/KubernetesLease.js.map +1 -0
- package/dist/coordination/leases/k8sApi.d.ts +82 -0
- package/dist/coordination/leases/k8sApi.d.ts.map +1 -0
- package/dist/coordination/leases/k8sApi.js +191 -0
- package/dist/coordination/leases/k8sApi.js.map +1 -0
- package/dist/crdt/Crdt.d.ts +52 -0
- package/dist/crdt/Crdt.d.ts.map +1 -0
- package/dist/crdt/Crdt.js +2 -0
- package/dist/crdt/Crdt.js.map +1 -0
- package/dist/crdt/DistributedData.d.ts +314 -0
- package/dist/crdt/DistributedData.d.ts.map +1 -0
- package/dist/crdt/DistributedData.js +658 -0
- package/dist/crdt/DistributedData.js.map +1 -0
- package/dist/crdt/DurableDistributedDataStore.d.ts +50 -0
- package/dist/crdt/DurableDistributedDataStore.d.ts.map +1 -0
- package/dist/crdt/DurableDistributedDataStore.js +75 -0
- package/dist/crdt/DurableDistributedDataStore.js.map +1 -0
- package/dist/crdt/GCounter.d.ts +42 -0
- package/dist/crdt/GCounter.d.ts.map +1 -0
- package/dist/crdt/GCounter.js +75 -0
- package/dist/crdt/GCounter.js.map +1 -0
- package/dist/crdt/GCounterMap.d.ts +60 -0
- package/dist/crdt/GCounterMap.d.ts.map +1 -0
- package/dist/crdt/GCounterMap.js +102 -0
- package/dist/crdt/GCounterMap.js.map +1 -0
- package/dist/crdt/GSet.d.ts +63 -0
- package/dist/crdt/GSet.d.ts.map +1 -0
- package/dist/crdt/GSet.js +77 -0
- package/dist/crdt/GSet.js.map +1 -0
- package/dist/crdt/LWWMap.d.ts +75 -0
- package/dist/crdt/LWWMap.d.ts.map +1 -0
- package/dist/crdt/LWWMap.js +136 -0
- package/dist/crdt/LWWMap.js.map +1 -0
- package/dist/crdt/LWWRegister.d.ts +54 -0
- package/dist/crdt/LWWRegister.d.ts.map +1 -0
- package/dist/crdt/LWWRegister.js +83 -0
- package/dist/crdt/LWWRegister.js.map +1 -0
- package/dist/crdt/MVRegister.d.ts +36 -0
- package/dist/crdt/MVRegister.d.ts.map +1 -0
- package/dist/crdt/MVRegister.js +138 -0
- package/dist/crdt/MVRegister.js.map +1 -0
- package/dist/crdt/ORMap.d.ts +104 -0
- package/dist/crdt/ORMap.d.ts.map +1 -0
- package/dist/crdt/ORMap.js +178 -0
- package/dist/crdt/ORMap.js.map +1 -0
- package/dist/crdt/ORSet.d.ts +81 -0
- package/dist/crdt/ORSet.d.ts.map +1 -0
- package/dist/crdt/ORSet.js +206 -0
- package/dist/crdt/ORSet.js.map +1 -0
- package/dist/crdt/PNCounter.d.ts +34 -0
- package/dist/crdt/PNCounter.d.ts.map +1 -0
- package/dist/crdt/PNCounter.js +51 -0
- package/dist/crdt/PNCounter.js.map +1 -0
- package/dist/crdt/index.d.ts +23 -0
- package/dist/crdt/index.d.ts.map +1 -0
- package/dist/crdt/index.js +12 -0
- package/dist/crdt/index.js.map +1 -0
- package/dist/delivery/ConsumerController.d.ts +28 -0
- package/dist/delivery/ConsumerController.d.ts.map +1 -0
- package/dist/delivery/ConsumerController.js +64 -0
- package/dist/delivery/ConsumerController.js.map +1 -0
- package/dist/delivery/Messages.d.ts +23 -0
- package/dist/delivery/Messages.d.ts.map +1 -0
- package/dist/delivery/Messages.js +2 -0
- package/dist/delivery/Messages.js.map +1 -0
- package/dist/delivery/ProducerController.d.ts +46 -0
- package/dist/delivery/ProducerController.d.ts.map +1 -0
- package/dist/delivery/ProducerController.js +84 -0
- package/dist/delivery/ProducerController.js.map +1 -0
- package/dist/delivery/ReliableDelivery.d.ts +36 -0
- package/dist/delivery/ReliableDelivery.d.ts.map +1 -0
- package/dist/delivery/ReliableDelivery.js +32 -0
- package/dist/delivery/ReliableDelivery.js.map +1 -0
- package/dist/delivery/index.d.ts +8 -0
- package/dist/delivery/index.d.ts.map +1 -0
- package/dist/delivery/index.js +4 -0
- package/dist/delivery/index.js.map +1 -0
- package/dist/discovery/AggregateSeedProvider.d.ts +15 -0
- package/dist/discovery/AggregateSeedProvider.d.ts.map +1 -0
- package/dist/discovery/AggregateSeedProvider.js +28 -0
- package/dist/discovery/AggregateSeedProvider.js.map +1 -0
- package/dist/discovery/ConfigSeedProvider.d.ts +20 -0
- package/dist/discovery/ConfigSeedProvider.d.ts.map +1 -0
- package/dist/discovery/ConfigSeedProvider.js +24 -0
- package/dist/discovery/ConfigSeedProvider.js.map +1 -0
- package/dist/discovery/DnsSeedProvider.d.ts +49 -0
- package/dist/discovery/DnsSeedProvider.d.ts.map +1 -0
- package/dist/discovery/DnsSeedProvider.js +57 -0
- package/dist/discovery/DnsSeedProvider.js.map +1 -0
- package/dist/discovery/KubernetesApiSeedProvider.d.ts +30 -0
- package/dist/discovery/KubernetesApiSeedProvider.d.ts.map +1 -0
- package/dist/discovery/KubernetesApiSeedProvider.js +66 -0
- package/dist/discovery/KubernetesApiSeedProvider.js.map +1 -0
- package/dist/discovery/Receptionist.d.ts +55 -0
- package/dist/discovery/Receptionist.d.ts.map +1 -0
- package/dist/discovery/Receptionist.js +207 -0
- package/dist/discovery/Receptionist.js.map +1 -0
- package/dist/discovery/ReceptionistMessages.d.ts +65 -0
- package/dist/discovery/ReceptionistMessages.d.ts.map +1 -0
- package/dist/discovery/ReceptionistMessages.js +76 -0
- package/dist/discovery/ReceptionistMessages.js.map +1 -0
- package/dist/discovery/SeedProvider.d.ts +17 -0
- package/dist/discovery/SeedProvider.d.ts.map +1 -0
- package/dist/discovery/SeedProvider.js +2 -0
- package/dist/discovery/SeedProvider.js.map +1 -0
- package/dist/discovery/ServiceKey.d.ts +15 -0
- package/dist/discovery/ServiceKey.d.ts.map +1 -0
- package/dist/discovery/ServiceKey.js +17 -0
- package/dist/discovery/ServiceKey.js.map +1 -0
- package/dist/discovery/autoDiscovery.d.ts +63 -0
- package/dist/discovery/autoDiscovery.d.ts.map +1 -0
- package/dist/discovery/autoDiscovery.js +91 -0
- package/dist/discovery/autoDiscovery.js.map +1 -0
- package/dist/discovery/index.d.ts +16 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +9 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/fsm/FSM.d.ts +60 -0
- package/dist/fsm/FSM.d.ts.map +1 -0
- package/dist/fsm/FSM.js +102 -0
- package/dist/fsm/FSM.js.map +1 -0
- package/dist/fsm/PersistentFSM.d.ts +230 -0
- package/dist/fsm/PersistentFSM.d.ts.map +1 -0
- package/dist/fsm/PersistentFSM.js +170 -0
- package/dist/fsm/PersistentFSM.js.map +1 -0
- package/dist/fsm/index.d.ts +5 -0
- package/dist/fsm/index.d.ts.map +1 -0
- package/dist/fsm/index.js +3 -0
- package/dist/fsm/index.js.map +1 -0
- package/dist/http/HttpClient.d.ts +34 -0
- package/dist/http/HttpClient.d.ts.map +1 -0
- package/dist/http/HttpClient.js +72 -0
- package/dist/http/HttpClient.js.map +1 -0
- package/dist/http/HttpExtension.d.ts +29 -0
- package/dist/http/HttpExtension.d.ts.map +1 -0
- package/dist/http/HttpExtension.js +64 -0
- package/dist/http/HttpExtension.js.map +1 -0
- package/dist/http/Marshalling.d.ts +20 -0
- package/dist/http/Marshalling.d.ts.map +1 -0
- package/dist/http/Marshalling.js +54 -0
- package/dist/http/Marshalling.js.map +1 -0
- package/dist/http/Route.d.ts +59 -0
- package/dist/http/Route.d.ts.map +1 -0
- package/dist/http/Route.js +93 -0
- package/dist/http/Route.js.map +1 -0
- package/dist/http/backend/ExpressBackend.d.ts +86 -0
- package/dist/http/backend/ExpressBackend.d.ts.map +1 -0
- package/dist/http/backend/ExpressBackend.js +260 -0
- package/dist/http/backend/ExpressBackend.js.map +1 -0
- package/dist/http/backend/FastifyBackend.d.ts +31 -0
- package/dist/http/backend/FastifyBackend.d.ts.map +1 -0
- package/dist/http/backend/FastifyBackend.js +193 -0
- package/dist/http/backend/FastifyBackend.js.map +1 -0
- package/dist/http/backend/HonoBackend.d.ts +72 -0
- package/dist/http/backend/HonoBackend.d.ts.map +1 -0
- package/dist/http/backend/HonoBackend.js +212 -0
- package/dist/http/backend/HonoBackend.js.map +1 -0
- package/dist/http/backend/HttpServerBackend.d.ts +31 -0
- package/dist/http/backend/HttpServerBackend.d.ts.map +1 -0
- package/dist/http/backend/HttpServerBackend.js +2 -0
- package/dist/http/backend/HttpServerBackend.js.map +1 -0
- package/dist/http/cache/IdempotencyKey.d.ts +48 -0
- package/dist/http/cache/IdempotencyKey.d.ts.map +1 -0
- package/dist/http/cache/IdempotencyKey.js +154 -0
- package/dist/http/cache/IdempotencyKey.js.map +1 -0
- package/dist/http/cache/RateLimit.d.ts +65 -0
- package/dist/http/cache/RateLimit.d.ts.map +1 -0
- package/dist/http/cache/RateLimit.js +60 -0
- package/dist/http/cache/RateLimit.js.map +1 -0
- package/dist/http/cache/ResponseCache.d.ts +49 -0
- package/dist/http/cache/ResponseCache.d.ts.map +1 -0
- package/dist/http/cache/ResponseCache.js +84 -0
- package/dist/http/cache/ResponseCache.js.map +1 -0
- package/dist/http/cache/index.d.ts +7 -0
- package/dist/http/cache/index.d.ts.map +1 -0
- package/dist/http/cache/index.js +4 -0
- package/dist/http/cache/index.js.map +1 -0
- package/dist/http/index.d.ts +18 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +11 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/types.d.ts +54 -0
- package/dist/http/types.d.ts.map +1 -0
- package/dist/http/types.js +40 -0
- package/dist/http/types.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/ActorCell.d.ts +116 -0
- package/dist/internal/ActorCell.d.ts.map +1 -0
- package/dist/internal/ActorCell.js +681 -0
- package/dist/internal/ActorCell.js.map +1 -0
- package/dist/internal/DeadLetterRef.d.ts +15 -0
- package/dist/internal/DeadLetterRef.d.ts.map +1 -0
- package/dist/internal/DeadLetterRef.js +24 -0
- package/dist/internal/DeadLetterRef.js.map +1 -0
- package/dist/internal/Guardian.d.ts +18 -0
- package/dist/internal/Guardian.d.ts.map +1 -0
- package/dist/internal/Guardian.js +23 -0
- package/dist/internal/Guardian.js.map +1 -0
- package/dist/internal/LocalActorRef.d.ts +17 -0
- package/dist/internal/LocalActorRef.d.ts.map +1 -0
- package/dist/internal/LocalActorRef.js +38 -0
- package/dist/internal/LocalActorRef.js.map +1 -0
- package/dist/internal/Mailbox.d.ts +49 -0
- package/dist/internal/Mailbox.d.ts.map +1 -0
- package/dist/internal/Mailbox.js +49 -0
- package/dist/internal/Mailbox.js.map +1 -0
- package/dist/internal/SystemCommand.d.ts +31 -0
- package/dist/internal/SystemCommand.d.ts.map +1 -0
- package/dist/internal/SystemCommand.js +2 -0
- package/dist/internal/SystemCommand.js.map +1 -0
- package/dist/io/broker/AmqpActor.d.ts +78 -0
- package/dist/io/broker/AmqpActor.d.ts.map +1 -0
- package/dist/io/broker/AmqpActor.js +137 -0
- package/dist/io/broker/AmqpActor.js.map +1 -0
- package/dist/io/broker/BrokerActor.d.ts +125 -0
- package/dist/io/broker/BrokerActor.d.ts.map +1 -0
- package/dist/io/broker/BrokerActor.js +289 -0
- package/dist/io/broker/BrokerActor.js.map +1 -0
- package/dist/io/broker/BrokerEvents.d.ts +59 -0
- package/dist/io/broker/BrokerEvents.d.ts.map +1 -0
- package/dist/io/broker/BrokerEvents.js +79 -0
- package/dist/io/broker/BrokerEvents.js.map +1 -0
- package/dist/io/broker/BrokerSettings.d.ts +72 -0
- package/dist/io/broker/BrokerSettings.d.ts.map +1 -0
- package/dist/io/broker/BrokerSettings.js +73 -0
- package/dist/io/broker/BrokerSettings.js.map +1 -0
- package/dist/io/broker/GrpcClientActor.d.ts +112 -0
- package/dist/io/broker/GrpcClientActor.d.ts.map +1 -0
- package/dist/io/broker/GrpcClientActor.js +212 -0
- package/dist/io/broker/GrpcClientActor.js.map +1 -0
- package/dist/io/broker/GrpcServerActor.d.ts +101 -0
- package/dist/io/broker/GrpcServerActor.d.ts.map +1 -0
- package/dist/io/broker/GrpcServerActor.js +230 -0
- package/dist/io/broker/GrpcServerActor.js.map +1 -0
- package/dist/io/broker/JetStreamActor.d.ts +352 -0
- package/dist/io/broker/JetStreamActor.d.ts.map +1 -0
- package/dist/io/broker/JetStreamActor.js +378 -0
- package/dist/io/broker/JetStreamActor.js.map +1 -0
- package/dist/io/broker/KafkaActor.d.ts +316 -0
- package/dist/io/broker/KafkaActor.d.ts.map +1 -0
- package/dist/io/broker/KafkaActor.js +355 -0
- package/dist/io/broker/KafkaActor.js.map +1 -0
- package/dist/io/broker/MqttActor.d.ts +149 -0
- package/dist/io/broker/MqttActor.d.ts.map +1 -0
- package/dist/io/broker/MqttActor.js +255 -0
- package/dist/io/broker/MqttActor.js.map +1 -0
- package/dist/io/broker/NatsActor.d.ts +65 -0
- package/dist/io/broker/NatsActor.d.ts.map +1 -0
- package/dist/io/broker/NatsActor.js +126 -0
- package/dist/io/broker/NatsActor.js.map +1 -0
- package/dist/io/broker/RedisStreamsActor.d.ts +69 -0
- package/dist/io/broker/RedisStreamsActor.d.ts.map +1 -0
- package/dist/io/broker/RedisStreamsActor.js +140 -0
- package/dist/io/broker/RedisStreamsActor.js.map +1 -0
- package/dist/io/broker/ServerWebSocketActor.d.ts +109 -0
- package/dist/io/broker/ServerWebSocketActor.d.ts.map +1 -0
- package/dist/io/broker/ServerWebSocketActor.js +128 -0
- package/dist/io/broker/ServerWebSocketActor.js.map +1 -0
- package/dist/io/broker/SseActor.d.ts +45 -0
- package/dist/io/broker/SseActor.d.ts.map +1 -0
- package/dist/io/broker/SseActor.js +129 -0
- package/dist/io/broker/SseActor.js.map +1 -0
- package/dist/io/broker/TcpSocketActor.d.ts +73 -0
- package/dist/io/broker/TcpSocketActor.d.ts.map +1 -0
- package/dist/io/broker/TcpSocketActor.js +168 -0
- package/dist/io/broker/TcpSocketActor.js.map +1 -0
- package/dist/io/broker/UdpSocketActor.d.ts +54 -0
- package/dist/io/broker/UdpSocketActor.d.ts.map +1 -0
- package/dist/io/broker/UdpSocketActor.js +100 -0
- package/dist/io/broker/UdpSocketActor.js.map +1 -0
- package/dist/io/broker/WebSocketActor.d.ts +77 -0
- package/dist/io/broker/WebSocketActor.d.ts.map +1 -0
- package/dist/io/broker/WebSocketActor.js +217 -0
- package/dist/io/broker/WebSocketActor.js.map +1 -0
- package/dist/io/broker/WebSocketServerAdapters.d.ts +140 -0
- package/dist/io/broker/WebSocketServerAdapters.d.ts.map +1 -0
- package/dist/io/broker/WebSocketServerAdapters.js +155 -0
- package/dist/io/broker/WebSocketServerAdapters.js.map +1 -0
- package/dist/io/broker/index.d.ts +32 -0
- package/dist/io/broker/index.d.ts.map +1 -0
- package/dist/io/broker/index.js +22 -0
- package/dist/io/broker/index.js.map +1 -0
- package/dist/io/index.d.ts +2 -0
- package/dist/io/index.d.ts.map +1 -0
- package/dist/io/index.js +2 -0
- package/dist/io/index.js.map +1 -0
- package/dist/mailbox/BoundedMailbox.d.ts +28 -0
- package/dist/mailbox/BoundedMailbox.d.ts.map +1 -0
- package/dist/mailbox/BoundedMailbox.js +41 -0
- package/dist/mailbox/BoundedMailbox.js.map +1 -0
- package/dist/mailbox/PriorityMailbox.d.ts +32 -0
- package/dist/mailbox/PriorityMailbox.d.ts.map +1 -0
- package/dist/mailbox/PriorityMailbox.js +58 -0
- package/dist/mailbox/PriorityMailbox.js.map +1 -0
- package/dist/mailbox/index.d.ts +5 -0
- package/dist/mailbox/index.d.ts.map +1 -0
- package/dist/mailbox/index.js +3 -0
- package/dist/mailbox/index.js.map +1 -0
- package/dist/management/HealthCheck.d.ts +21 -0
- package/dist/management/HealthCheck.d.ts.map +1 -0
- package/dist/management/HealthCheck.js +46 -0
- package/dist/management/HealthCheck.js.map +1 -0
- package/dist/management/HttpManagement.d.ts +43 -0
- package/dist/management/HttpManagement.d.ts.map +1 -0
- package/dist/management/HttpManagement.js +158 -0
- package/dist/management/HttpManagement.js.map +1 -0
- package/dist/management/index.d.ts +5 -0
- package/dist/management/index.d.ts.map +1 -0
- package/dist/management/index.js +3 -0
- package/dist/management/index.js.map +1 -0
- package/dist/metrics/Metrics.d.ts +142 -0
- package/dist/metrics/Metrics.d.ts.map +1 -0
- package/dist/metrics/Metrics.js +231 -0
- package/dist/metrics/Metrics.js.map +1 -0
- package/dist/metrics/MetricsExtension.d.ts +51 -0
- package/dist/metrics/MetricsExtension.d.ts.map +1 -0
- package/dist/metrics/MetricsExtension.js +63 -0
- package/dist/metrics/MetricsExtension.js.map +1 -0
- package/dist/metrics/PromClientAdapter.d.ts +102 -0
- package/dist/metrics/PromClientAdapter.d.ts.map +1 -0
- package/dist/metrics/PromClientAdapter.js +244 -0
- package/dist/metrics/PromClientAdapter.js.map +1 -0
- package/dist/metrics/PrometheusExporter.d.ts +31 -0
- package/dist/metrics/PrometheusExporter.d.ts.map +1 -0
- package/dist/metrics/PrometheusExporter.js +128 -0
- package/dist/metrics/PrometheusExporter.js.map +1 -0
- package/dist/metrics/index.d.ts +7 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/index.js +5 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/pattern/BackoffPolicy.d.ts +67 -0
- package/dist/pattern/BackoffPolicy.d.ts.map +1 -0
- package/dist/pattern/BackoffPolicy.js +87 -0
- package/dist/pattern/BackoffPolicy.js.map +1 -0
- package/dist/pattern/BackoffSupervisor.d.ts +234 -0
- package/dist/pattern/BackoffSupervisor.d.ts.map +1 -0
- package/dist/pattern/BackoffSupervisor.js +292 -0
- package/dist/pattern/BackoffSupervisor.js.map +1 -0
- package/dist/pattern/CircuitBreaker.d.ts +49 -0
- package/dist/pattern/CircuitBreaker.d.ts.map +1 -0
- package/dist/pattern/CircuitBreaker.js +110 -0
- package/dist/pattern/CircuitBreaker.js.map +1 -0
- package/dist/pattern/Status.d.ts +13 -0
- package/dist/pattern/Status.d.ts.map +1 -0
- package/dist/pattern/Status.js +13 -0
- package/dist/pattern/Status.js.map +1 -0
- package/dist/pattern/after.d.ts +13 -0
- package/dist/pattern/after.d.ts.map +1 -0
- package/dist/pattern/after.js +26 -0
- package/dist/pattern/after.js.map +1 -0
- package/dist/pattern/index.d.ts +14 -0
- package/dist/pattern/index.d.ts.map +1 -0
- package/dist/pattern/index.js +8 -0
- package/dist/pattern/index.js.map +1 -0
- package/dist/pattern/pipeTo.d.ts +20 -0
- package/dist/pattern/pipeTo.d.ts.map +1 -0
- package/dist/pattern/pipeTo.js +22 -0
- package/dist/pattern/pipeTo.js.map +1 -0
- package/dist/pattern/retry.d.ts +24 -0
- package/dist/pattern/retry.d.ts.map +1 -0
- package/dist/pattern/retry.js +35 -0
- package/dist/pattern/retry.js.map +1 -0
- package/dist/persistence/DurableStateActor.d.ts +62 -0
- package/dist/persistence/DurableStateActor.d.ts.map +1 -0
- package/dist/persistence/DurableStateActor.js +120 -0
- package/dist/persistence/DurableStateActor.js.map +1 -0
- package/dist/persistence/DurableStateStore.d.ts +43 -0
- package/dist/persistence/DurableStateStore.d.ts.map +1 -0
- package/dist/persistence/DurableStateStore.js +13 -0
- package/dist/persistence/DurableStateStore.js.map +1 -0
- package/dist/persistence/EventDispatcher.d.ts +88 -0
- package/dist/persistence/EventDispatcher.d.ts.map +1 -0
- package/dist/persistence/EventDispatcher.js +81 -0
- package/dist/persistence/EventDispatcher.js.map +1 -0
- package/dist/persistence/Journal.d.ts +40 -0
- package/dist/persistence/Journal.d.ts.map +1 -0
- package/dist/persistence/Journal.js +2 -0
- package/dist/persistence/Journal.js.map +1 -0
- package/dist/persistence/JournalEventBus.d.ts +47 -0
- package/dist/persistence/JournalEventBus.d.ts.map +1 -0
- package/dist/persistence/JournalEventBus.js +26 -0
- package/dist/persistence/JournalEventBus.js.map +1 -0
- package/dist/persistence/JournalTypes.d.ts +39 -0
- package/dist/persistence/JournalTypes.d.ts.map +1 -0
- package/dist/persistence/JournalTypes.js +28 -0
- package/dist/persistence/JournalTypes.js.map +1 -0
- package/dist/persistence/PersistenceExtension.d.ts +32 -0
- package/dist/persistence/PersistenceExtension.d.ts.map +1 -0
- package/dist/persistence/PersistenceExtension.js +69 -0
- package/dist/persistence/PersistenceExtension.js.map +1 -0
- package/dist/persistence/PersistenceOptions.d.ts +95 -0
- package/dist/persistence/PersistenceOptions.d.ts.map +1 -0
- package/dist/persistence/PersistenceOptions.js +20 -0
- package/dist/persistence/PersistenceOptions.js.map +1 -0
- package/dist/persistence/PersistentActor.d.ts +120 -0
- package/dist/persistence/PersistentActor.d.ts.map +1 -0
- package/dist/persistence/PersistentActor.js +246 -0
- package/dist/persistence/PersistentActor.js.map +1 -0
- package/dist/persistence/ReplicatedEventSourcedActor.d.ts +238 -0
- package/dist/persistence/ReplicatedEventSourcedActor.d.ts.map +1 -0
- package/dist/persistence/ReplicatedEventSourcedActor.js +430 -0
- package/dist/persistence/ReplicatedEventSourcedActor.js.map +1 -0
- package/dist/persistence/SnapshotStore.d.ts +31 -0
- package/dist/persistence/SnapshotStore.d.ts.map +1 -0
- package/dist/persistence/SnapshotStore.js +2 -0
- package/dist/persistence/SnapshotStore.js.map +1 -0
- package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.d.ts +14 -0
- package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.d.ts.map +1 -0
- package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.js +31 -0
- package/dist/persistence/durable-state-stores/InMemoryDurableStateStore.js.map +1 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts +27 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.d.ts.map +1 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js +157 -0
- package/dist/persistence/durable-state-stores/ObjectStorageDurableStateStore.js.map +1 -0
- package/dist/persistence/index.d.ts +65 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +44 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/journals/CassandraClient.d.ts +81 -0
- package/dist/persistence/journals/CassandraClient.d.ts.map +1 -0
- package/dist/persistence/journals/CassandraClient.js +65 -0
- package/dist/persistence/journals/CassandraClient.js.map +1 -0
- package/dist/persistence/journals/CassandraJournal.d.ts +96 -0
- package/dist/persistence/journals/CassandraJournal.d.ts.map +1 -0
- package/dist/persistence/journals/CassandraJournal.js +247 -0
- package/dist/persistence/journals/CassandraJournal.js.map +1 -0
- package/dist/persistence/journals/CassandraPlugin.d.ts +30 -0
- package/dist/persistence/journals/CassandraPlugin.d.ts.map +1 -0
- package/dist/persistence/journals/CassandraPlugin.js +18 -0
- package/dist/persistence/journals/CassandraPlugin.js.map +1 -0
- package/dist/persistence/journals/InMemoryJournal.d.ts +35 -0
- package/dist/persistence/journals/InMemoryJournal.d.ts.map +1 -0
- package/dist/persistence/journals/InMemoryJournal.js +97 -0
- package/dist/persistence/journals/InMemoryJournal.js.map +1 -0
- package/dist/persistence/journals/SqliteJournal.d.ts +68 -0
- package/dist/persistence/journals/SqliteJournal.d.ts.map +1 -0
- package/dist/persistence/journals/SqliteJournal.js +225 -0
- package/dist/persistence/journals/SqliteJournal.js.map +1 -0
- package/dist/persistence/migration/Adapter.d.ts +72 -0
- package/dist/persistence/migration/Adapter.d.ts.map +1 -0
- package/dist/persistence/migration/Adapter.js +24 -0
- package/dist/persistence/migration/Adapter.js.map +1 -0
- package/dist/persistence/migration/Codec.d.ts +103 -0
- package/dist/persistence/migration/Codec.d.ts.map +1 -0
- package/dist/persistence/migration/Codec.js +92 -0
- package/dist/persistence/migration/Codec.js.map +1 -0
- package/dist/persistence/migration/Envelope.d.ts +37 -0
- package/dist/persistence/migration/Envelope.d.ts.map +1 -0
- package/dist/persistence/migration/Envelope.js +79 -0
- package/dist/persistence/migration/Envelope.js.map +1 -0
- package/dist/persistence/migration/MigrationChain.d.ts +100 -0
- package/dist/persistence/migration/MigrationChain.d.ts.map +1 -0
- package/dist/persistence/migration/MigrationChain.js +159 -0
- package/dist/persistence/migration/MigrationChain.js.map +1 -0
- package/dist/persistence/migration/SchemaRegistry.d.ts +114 -0
- package/dist/persistence/migration/SchemaRegistry.d.ts.map +1 -0
- package/dist/persistence/migration/SchemaRegistry.js +112 -0
- package/dist/persistence/migration/SchemaRegistry.js.map +1 -0
- package/dist/persistence/migration/defaultsAdapter.d.ts +56 -0
- package/dist/persistence/migration/defaultsAdapter.d.ts.map +1 -0
- package/dist/persistence/migration/defaultsAdapter.js +119 -0
- package/dist/persistence/migration/defaultsAdapter.js.map +1 -0
- package/dist/persistence/migration/index.d.ts +18 -0
- package/dist/persistence/migration/index.d.ts.map +1 -0
- package/dist/persistence/migration/index.js +12 -0
- package/dist/persistence/migration/index.js.map +1 -0
- package/dist/persistence/migration/journalMigration.d.ts +155 -0
- package/dist/persistence/migration/journalMigration.d.ts.map +1 -0
- package/dist/persistence/migration/journalMigration.js +149 -0
- package/dist/persistence/migration/journalMigration.js.map +1 -0
- package/dist/persistence/migration/migratingAdapter.d.ts +43 -0
- package/dist/persistence/migration/migratingAdapter.d.ts.map +1 -0
- package/dist/persistence/migration/migratingAdapter.js +65 -0
- package/dist/persistence/migration/migratingAdapter.js.map +1 -0
- package/dist/persistence/migration/validatedAdapter.d.ts +48 -0
- package/dist/persistence/migration/validatedAdapter.d.ts.map +1 -0
- package/dist/persistence/migration/validatedAdapter.js +86 -0
- package/dist/persistence/migration/validatedAdapter.js.map +1 -0
- package/dist/persistence/migration/wrapLegacy.d.ts +83 -0
- package/dist/persistence/migration/wrapLegacy.d.ts.map +1 -0
- package/dist/persistence/migration/wrapLegacy.js +126 -0
- package/dist/persistence/migration/wrapLegacy.js.map +1 -0
- package/dist/persistence/object-storage/BodyCodec.d.ts +88 -0
- package/dist/persistence/object-storage/BodyCodec.d.ts.map +1 -0
- package/dist/persistence/object-storage/BodyCodec.js +171 -0
- package/dist/persistence/object-storage/BodyCodec.js.map +1 -0
- package/dist/persistence/object-storage/Compression.d.ts +31 -0
- package/dist/persistence/object-storage/Compression.d.ts.map +1 -0
- package/dist/persistence/object-storage/Compression.js +99 -0
- package/dist/persistence/object-storage/Compression.js.map +1 -0
- package/dist/persistence/object-storage/Encryption.d.ts +73 -0
- package/dist/persistence/object-storage/Encryption.d.ts.map +1 -0
- package/dist/persistence/object-storage/Encryption.js +167 -0
- package/dist/persistence/object-storage/Encryption.js.map +1 -0
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts +79 -0
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.d.ts.map +1 -0
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js +325 -0
- package/dist/persistence/object-storage/FilesystemObjectStorageBackend.js.map +1 -0
- package/dist/persistence/object-storage/ObjectStorageBackend.d.ts +86 -0
- package/dist/persistence/object-storage/ObjectStorageBackend.d.ts.map +1 -0
- package/dist/persistence/object-storage/ObjectStorageBackend.js +24 -0
- package/dist/persistence/object-storage/ObjectStorageBackend.js.map +1 -0
- package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts +93 -0
- package/dist/persistence/object-storage/ObjectStoragePlugin.d.ts.map +1 -0
- package/dist/persistence/object-storage/ObjectStoragePlugin.js +113 -0
- package/dist/persistence/object-storage/ObjectStoragePlugin.js.map +1 -0
- package/dist/persistence/object-storage/PluginConfig.d.ts +67 -0
- package/dist/persistence/object-storage/PluginConfig.d.ts.map +1 -0
- package/dist/persistence/object-storage/PluginConfig.js +93 -0
- package/dist/persistence/object-storage/PluginConfig.js.map +1 -0
- package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts +104 -0
- package/dist/persistence/object-storage/S3ObjectStorageBackend.d.ts.map +1 -0
- package/dist/persistence/object-storage/S3ObjectStorageBackend.js +202 -0
- package/dist/persistence/object-storage/S3ObjectStorageBackend.js.map +1 -0
- package/dist/persistence/object-storage/reEncryptionSweep.d.ts +110 -0
- package/dist/persistence/object-storage/reEncryptionSweep.d.ts.map +1 -0
- package/dist/persistence/object-storage/reEncryptionSweep.js +157 -0
- package/dist/persistence/object-storage/reEncryptionSweep.js.map +1 -0
- package/dist/persistence/projection/OffsetStore.d.ts +69 -0
- package/dist/persistence/projection/OffsetStore.d.ts.map +1 -0
- package/dist/persistence/projection/OffsetStore.js +103 -0
- package/dist/persistence/projection/OffsetStore.js.map +1 -0
- package/dist/persistence/projection/ProjectionActor.d.ts +62 -0
- package/dist/persistence/projection/ProjectionActor.d.ts.map +1 -0
- package/dist/persistence/projection/ProjectionActor.js +120 -0
- package/dist/persistence/projection/ProjectionActor.js.map +1 -0
- package/dist/persistence/query/CassandraQuery.d.ts +42 -0
- package/dist/persistence/query/CassandraQuery.d.ts.map +1 -0
- package/dist/persistence/query/CassandraQuery.js +118 -0
- package/dist/persistence/query/CassandraQuery.js.map +1 -0
- package/dist/persistence/query/InMemoryQuery.d.ts +31 -0
- package/dist/persistence/query/InMemoryQuery.d.ts.map +1 -0
- package/dist/persistence/query/InMemoryQuery.js +285 -0
- package/dist/persistence/query/InMemoryQuery.js.map +1 -0
- package/dist/persistence/query/PersistenceQuery.d.ts +162 -0
- package/dist/persistence/query/PersistenceQuery.d.ts.map +1 -0
- package/dist/persistence/query/PersistenceQuery.js +78 -0
- package/dist/persistence/query/PersistenceQuery.js.map +1 -0
- package/dist/persistence/query/SqliteQuery.d.ts +58 -0
- package/dist/persistence/query/SqliteQuery.d.ts.map +1 -0
- package/dist/persistence/query/SqliteQuery.js +173 -0
- package/dist/persistence/query/SqliteQuery.js.map +1 -0
- package/dist/persistence/replicated/ConflictResolver.d.ts +70 -0
- package/dist/persistence/replicated/ConflictResolver.d.ts.map +1 -0
- package/dist/persistence/replicated/ConflictResolver.js +47 -0
- package/dist/persistence/replicated/ConflictResolver.js.map +1 -0
- package/dist/persistence/replicated/ReplicatedSnapshot.d.ts +43 -0
- package/dist/persistence/replicated/ReplicatedSnapshot.d.ts.map +1 -0
- package/dist/persistence/replicated/ReplicatedSnapshot.js +2 -0
- package/dist/persistence/replicated/ReplicatedSnapshot.js.map +1 -0
- package/dist/persistence/replicated/VectorClock.d.ts +57 -0
- package/dist/persistence/replicated/VectorClock.d.ts.map +1 -0
- package/dist/persistence/replicated/VectorClock.js +79 -0
- package/dist/persistence/replicated/VectorClock.js.map +1 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts +27 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.js +82 -0
- package/dist/persistence/snapshot-stores/CachedSnapshotStore.js.map +1 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts +42 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js +121 -0
- package/dist/persistence/snapshot-stores/CassandraSnapshotStore.js.map +1 -0
- package/dist/persistence/snapshot-stores/InMemorySnapshotStore.d.ts +19 -0
- package/dist/persistence/snapshot-stores/InMemorySnapshotStore.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/InMemorySnapshotStore.js +44 -0
- package/dist/persistence/snapshot-stores/InMemorySnapshotStore.js.map +1 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts +46 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js +172 -0
- package/dist/persistence/snapshot-stores/ObjectStorageSnapshotStore.js.map +1 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts +42 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.d.ts.map +1 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js +108 -0
- package/dist/persistence/snapshot-stores/SqliteSnapshotStore.js.map +1 -0
- package/dist/persistence/storage/KeyValidator.d.ts +80 -0
- package/dist/persistence/storage/KeyValidator.d.ts.map +1 -0
- package/dist/persistence/storage/KeyValidator.js +88 -0
- package/dist/persistence/storage/KeyValidator.js.map +1 -0
- package/dist/runtime/detect.d.ts +35 -0
- package/dist/runtime/detect.d.ts.map +1 -0
- package/dist/runtime/detect.js +60 -0
- package/dist/runtime/detect.js.map +1 -0
- package/dist/runtime/http/BunHonoRunner.d.ts +16 -0
- package/dist/runtime/http/BunHonoRunner.d.ts.map +1 -0
- package/dist/runtime/http/BunHonoRunner.js +26 -0
- package/dist/runtime/http/BunHonoRunner.js.map +1 -0
- package/dist/runtime/http/DenoHonoRunner.d.ts +16 -0
- package/dist/runtime/http/DenoHonoRunner.d.ts.map +1 -0
- package/dist/runtime/http/DenoHonoRunner.js +33 -0
- package/dist/runtime/http/DenoHonoRunner.js.map +1 -0
- package/dist/runtime/http/HonoServerRunner.d.ts +28 -0
- package/dist/runtime/http/HonoServerRunner.d.ts.map +1 -0
- package/dist/runtime/http/HonoServerRunner.js +16 -0
- package/dist/runtime/http/HonoServerRunner.js.map +1 -0
- package/dist/runtime/http/NodeHonoRunner.d.ts +19 -0
- package/dist/runtime/http/NodeHonoRunner.d.ts.map +1 -0
- package/dist/runtime/http/NodeHonoRunner.js +70 -0
- package/dist/runtime/http/NodeHonoRunner.js.map +1 -0
- package/dist/runtime/http/index.d.ts +13 -0
- package/dist/runtime/http/index.d.ts.map +1 -0
- package/dist/runtime/http/index.js +40 -0
- package/dist/runtime/http/index.js.map +1 -0
- package/dist/runtime/sqlite/BetterSqliteDriver.d.ts +18 -0
- package/dist/runtime/sqlite/BetterSqliteDriver.d.ts.map +1 -0
- package/dist/runtime/sqlite/BetterSqliteDriver.js +64 -0
- package/dist/runtime/sqlite/BetterSqliteDriver.js.map +1 -0
- package/dist/runtime/sqlite/BunSqliteDriver.d.ts +17 -0
- package/dist/runtime/sqlite/BunSqliteDriver.d.ts.map +1 -0
- package/dist/runtime/sqlite/BunSqliteDriver.js +34 -0
- package/dist/runtime/sqlite/BunSqliteDriver.js.map +1 -0
- package/dist/runtime/sqlite/SqliteDriver.d.ts +35 -0
- package/dist/runtime/sqlite/SqliteDriver.d.ts.map +1 -0
- package/dist/runtime/sqlite/SqliteDriver.js +13 -0
- package/dist/runtime/sqlite/SqliteDriver.js.map +1 -0
- package/dist/runtime/sqlite/index.d.ts +14 -0
- package/dist/runtime/sqlite/index.d.ts.map +1 -0
- package/dist/runtime/sqlite/index.js +41 -0
- package/dist/runtime/sqlite/index.js.map +1 -0
- package/dist/runtime/tcp/BunTcpBackend.d.ts +24 -0
- package/dist/runtime/tcp/BunTcpBackend.d.ts.map +1 -0
- package/dist/runtime/tcp/BunTcpBackend.js +66 -0
- package/dist/runtime/tcp/BunTcpBackend.js.map +1 -0
- package/dist/runtime/tcp/DenoTcpBackend.d.ts +30 -0
- package/dist/runtime/tcp/DenoTcpBackend.d.ts.map +1 -0
- package/dist/runtime/tcp/DenoTcpBackend.js +145 -0
- package/dist/runtime/tcp/DenoTcpBackend.js.map +1 -0
- package/dist/runtime/tcp/NodeTcpBackend.d.ts +25 -0
- package/dist/runtime/tcp/NodeTcpBackend.d.ts.map +1 -0
- package/dist/runtime/tcp/NodeTcpBackend.js +102 -0
- package/dist/runtime/tcp/NodeTcpBackend.js.map +1 -0
- package/dist/runtime/tcp/TcpBackend.d.ts +65 -0
- package/dist/runtime/tcp/TcpBackend.d.ts.map +1 -0
- package/dist/runtime/tcp/TcpBackend.js +17 -0
- package/dist/runtime/tcp/TcpBackend.js.map +1 -0
- package/dist/runtime/tcp/index.d.ts +13 -0
- package/dist/runtime/tcp/index.d.ts.map +1 -0
- package/dist/runtime/tcp/index.js +40 -0
- package/dist/runtime/tcp/index.js.map +1 -0
- package/dist/runtime/worker/NodeWorkerBackend.d.ts +19 -0
- package/dist/runtime/worker/NodeWorkerBackend.d.ts.map +1 -0
- package/dist/runtime/worker/NodeWorkerBackend.js +84 -0
- package/dist/runtime/worker/NodeWorkerBackend.js.map +1 -0
- package/dist/runtime/worker/WebWorkerBackend.d.ts +12 -0
- package/dist/runtime/worker/WebWorkerBackend.d.ts.map +1 -0
- package/dist/runtime/worker/WebWorkerBackend.js +55 -0
- package/dist/runtime/worker/WebWorkerBackend.js.map +1 -0
- package/dist/runtime/worker/WorkerBackend.d.ts +45 -0
- package/dist/runtime/worker/WorkerBackend.d.ts.map +1 -0
- package/dist/runtime/worker/WorkerBackend.js +18 -0
- package/dist/runtime/worker/WorkerBackend.js.map +1 -0
- package/dist/runtime/worker/index.d.ts +14 -0
- package/dist/runtime/worker/index.d.ts.map +1 -0
- package/dist/runtime/worker/index.js +34 -0
- package/dist/runtime/worker/index.js.map +1 -0
- package/dist/serialization/CborCodec.d.ts +51 -0
- package/dist/serialization/CborCodec.d.ts.map +1 -0
- package/dist/serialization/CborCodec.js +321 -0
- package/dist/serialization/CborCodec.js.map +1 -0
- package/dist/serialization/CborSerializer.d.ts +23 -0
- package/dist/serialization/CborSerializer.d.ts.map +1 -0
- package/dist/serialization/CborSerializer.js +27 -0
- package/dist/serialization/CborSerializer.js.map +1 -0
- package/dist/serialization/JsonSerializer.d.ts +18 -0
- package/dist/serialization/JsonSerializer.d.ts.map +1 -0
- package/dist/serialization/JsonSerializer.js +114 -0
- package/dist/serialization/JsonSerializer.js.map +1 -0
- package/dist/serialization/SerializationExtension.d.ts +46 -0
- package/dist/serialization/SerializationExtension.d.ts.map +1 -0
- package/dist/serialization/SerializationExtension.js +105 -0
- package/dist/serialization/SerializationExtension.js.map +1 -0
- package/dist/serialization/Serializer.d.ts +44 -0
- package/dist/serialization/Serializer.d.ts.map +1 -0
- package/dist/serialization/Serializer.js +7 -0
- package/dist/serialization/Serializer.js.map +1 -0
- package/dist/serialization/index.d.ts +7 -0
- package/dist/serialization/index.d.ts.map +1 -0
- package/dist/serialization/index.js +6 -0
- package/dist/serialization/index.js.map +1 -0
- package/dist/testkit/ManualScheduler.d.ts +35 -0
- package/dist/testkit/ManualScheduler.d.ts.map +1 -0
- package/dist/testkit/ManualScheduler.js +126 -0
- package/dist/testkit/ManualScheduler.js.map +1 -0
- package/dist/testkit/MultiNodeSpec.d.ts +132 -0
- package/dist/testkit/MultiNodeSpec.d.ts.map +1 -0
- package/dist/testkit/MultiNodeSpec.js +237 -0
- package/dist/testkit/MultiNodeSpec.js.map +1 -0
- package/dist/testkit/ParallelMultiNodeSpec.d.ts +117 -0
- package/dist/testkit/ParallelMultiNodeSpec.d.ts.map +1 -0
- package/dist/testkit/ParallelMultiNodeSpec.js +310 -0
- package/dist/testkit/ParallelMultiNodeSpec.js.map +1 -0
- package/dist/testkit/TestKit.d.ts +40 -0
- package/dist/testkit/TestKit.d.ts.map +1 -0
- package/dist/testkit/TestKit.js +60 -0
- package/dist/testkit/TestKit.js.map +1 -0
- package/dist/testkit/TestProbe.d.ts +56 -0
- package/dist/testkit/TestProbe.d.ts.map +1 -0
- package/dist/testkit/TestProbe.js +184 -0
- package/dist/testkit/TestProbe.js.map +1 -0
- package/dist/testkit/index.d.ts +11 -0
- package/dist/testkit/index.d.ts.map +1 -0
- package/dist/testkit/index.js +6 -0
- package/dist/testkit/index.js.map +1 -0
- package/dist/testkit/internal/MultiNodeBroker.d.ts +39 -0
- package/dist/testkit/internal/MultiNodeBroker.d.ts.map +1 -0
- package/dist/testkit/internal/MultiNodeBroker.js +96 -0
- package/dist/testkit/internal/MultiNodeBroker.js.map +1 -0
- package/dist/testkit/internal/MultiNodeTransport.d.ts +58 -0
- package/dist/testkit/internal/MultiNodeTransport.d.ts.map +1 -0
- package/dist/testkit/internal/MultiNodeTransport.js +96 -0
- package/dist/testkit/internal/MultiNodeTransport.js.map +1 -0
- package/dist/testkit/internal/parallel-multi-node-bootstrap.d.ts +54 -0
- package/dist/testkit/internal/parallel-multi-node-bootstrap.d.ts.map +1 -0
- package/dist/testkit/internal/parallel-multi-node-bootstrap.js +157 -0
- package/dist/testkit/internal/parallel-multi-node-bootstrap.js.map +1 -0
- package/dist/tracing/NoopTracer.d.ts +11 -0
- package/dist/tracing/NoopTracer.d.ts.map +1 -0
- package/dist/tracing/NoopTracer.js +29 -0
- package/dist/tracing/NoopTracer.js.map +1 -0
- package/dist/tracing/OtelAdapter.d.ts +106 -0
- package/dist/tracing/OtelAdapter.d.ts.map +1 -0
- package/dist/tracing/OtelAdapter.js +164 -0
- package/dist/tracing/OtelAdapter.js.map +1 -0
- package/dist/tracing/RecordingTracer.d.ts +54 -0
- package/dist/tracing/RecordingTracer.d.ts.map +1 -0
- package/dist/tracing/RecordingTracer.js +129 -0
- package/dist/tracing/RecordingTracer.js.map +1 -0
- package/dist/tracing/Tracer.d.ts +100 -0
- package/dist/tracing/Tracer.d.ts.map +1 -0
- package/dist/tracing/Tracer.js +76 -0
- package/dist/tracing/Tracer.js.map +1 -0
- package/dist/tracing/TracingExtension.d.ts +32 -0
- package/dist/tracing/TracingExtension.d.ts.map +1 -0
- package/dist/tracing/TracingExtension.js +38 -0
- package/dist/tracing/TracingExtension.js.map +1 -0
- package/dist/tracing/index.d.ts +9 -0
- package/dist/tracing/index.d.ts.map +1 -0
- package/dist/tracing/index.js +6 -0
- package/dist/tracing/index.js.map +1 -0
- package/dist/typed/Behavior.d.ts +78 -0
- package/dist/typed/Behavior.d.ts.map +1 -0
- package/dist/typed/Behavior.js +2 -0
- package/dist/typed/Behavior.js.map +1 -0
- package/dist/typed/Behaviors.d.ts +60 -0
- package/dist/typed/Behaviors.d.ts.map +1 -0
- package/dist/typed/Behaviors.js +77 -0
- package/dist/typed/Behaviors.js.map +1 -0
- package/dist/typed/TypedActor.d.ts +28 -0
- package/dist/typed/TypedActor.d.ts.map +1 -0
- package/dist/typed/TypedActor.js +194 -0
- package/dist/typed/TypedActor.js.map +1 -0
- package/dist/typed/TypedActorContext.d.ts +29 -0
- package/dist/typed/TypedActorContext.d.ts.map +1 -0
- package/dist/typed/TypedActorContext.js +2 -0
- package/dist/typed/TypedActorContext.js.map +1 -0
- package/dist/typed/index.d.ts +7 -0
- package/dist/typed/index.d.ts.map +1 -0
- package/dist/typed/index.js +4 -0
- package/dist/typed/index.js.map +1 -0
- package/dist/typed/spawn.d.ts +14 -0
- package/dist/typed/spawn.d.ts.map +1 -0
- package/dist/typed/spawn.js +16 -0
- package/dist/typed/spawn.js.map +1 -0
- package/dist/util/Constants.d.ts +66 -0
- package/dist/util/Constants.d.ts.map +1 -0
- package/dist/util/Constants.js +66 -0
- package/dist/util/Constants.js.map +1 -0
- package/dist/util/Either.d.ts +100 -0
- package/dist/util/Either.d.ts.map +1 -0
- package/dist/util/Either.js +128 -0
- package/dist/util/Either.js.map +1 -0
- package/dist/util/Lazy.d.ts +82 -0
- package/dist/util/Lazy.d.ts.map +1 -0
- package/dist/util/Lazy.js +119 -0
- package/dist/util/Lazy.js.map +1 -0
- package/dist/util/LazyImport.d.ts +68 -0
- package/dist/util/LazyImport.d.ts.map +1 -0
- package/dist/util/LazyImport.js +64 -0
- package/dist/util/LazyImport.js.map +1 -0
- package/dist/util/Option.d.ts +105 -0
- package/dist/util/Option.d.ts.map +1 -0
- package/dist/util/Option.js +123 -0
- package/dist/util/Option.js.map +1 -0
- package/dist/util/TokenBucket.d.ts +59 -0
- package/dist/util/TokenBucket.d.ts.map +1 -0
- package/dist/util/TokenBucket.js +76 -0
- package/dist/util/TokenBucket.js.map +1 -0
- package/dist/util/Try.d.ts +103 -0
- package/dist/util/Try.d.ts.map +1 -0
- package/dist/util/Try.js +176 -0
- package/dist/util/Try.js.map +1 -0
- package/dist/util/WrapError.d.ts +42 -0
- package/dist/util/WrapError.d.ts.map +1 -0
- package/dist/util/WrapError.js +46 -0
- package/dist/util/WrapError.js.map +1 -0
- package/dist/worker/WorkerBroker.d.ts +29 -0
- package/dist/worker/WorkerBroker.d.ts.map +1 -0
- package/dist/worker/WorkerBroker.js +74 -0
- package/dist/worker/WorkerBroker.js.map +1 -0
- package/dist/worker/WorkerCluster.d.ts +68 -0
- package/dist/worker/WorkerCluster.d.ts.map +1 -0
- package/dist/worker/WorkerCluster.js +161 -0
- package/dist/worker/WorkerCluster.js.map +1 -0
- package/dist/worker/WorkerNode.d.ts +20 -0
- package/dist/worker/WorkerNode.d.ts.map +1 -0
- package/dist/worker/WorkerNode.js +84 -0
- package/dist/worker/WorkerNode.js.map +1 -0
- package/dist/worker/index.d.ts +6 -0
- package/dist/worker/index.d.ts.map +1 -0
- package/dist/worker/index.js +4 -0
- package/dist/worker/index.js.map +1 -0
- package/package.json +148 -0
|
@@ -0,0 +1,837 @@
|
|
|
1
|
+
import { match } from 'ts-pattern';
|
|
2
|
+
import { LogContext } from '../LogContext.js';
|
|
3
|
+
import { metricsOf } from '../metrics/MetricsExtension.js';
|
|
4
|
+
import { tracerOf } from '../tracing/TracingExtension.js';
|
|
5
|
+
import { DEFAULT_GOSSIP_INTERVAL_MS, DEFAULT_SEED_RETRY_INTERVAL_MS, DEFAULT_TOMBSTONE_PRUNE_INTERVAL_MS, DEFAULT_TOMBSTONE_TTL_MS, } from '../util/Constants.js';
|
|
6
|
+
import { none, some } from '../util/Option.js';
|
|
7
|
+
import { LeaderChanged, MemberDown, MemberJoined, MemberLeft, MemberReachable, MemberRemoved, MemberUnreachable, MemberUp, MemberWeaklyUp, SelfRemoved, SelfUp, } from './ClusterEvents.js';
|
|
8
|
+
import { defaultFailureDetectorSettings, FailureDetector, } from './FailureDetector.js';
|
|
9
|
+
import { Member } from './Member.js';
|
|
10
|
+
import { NodeAddress } from './NodeAddress.js';
|
|
11
|
+
// `ClusterSharding` only imports `Cluster` as a type (erased at runtime),
|
|
12
|
+
// so the value-import here doesn't create a runtime cycle — every
|
|
13
|
+
// sharding file uses `import type { Cluster }`.
|
|
14
|
+
import { ClusterSharding } from './sharding/ClusterSharding.js';
|
|
15
|
+
import { decodeRefs, encodeRefs, parsePathSegments } from './RefCodec.js';
|
|
16
|
+
import { InMemoryTransport, TcpTransport } from './Transport.js';
|
|
17
|
+
/**
|
|
18
|
+
* Maximum allowed deviation between an incoming gossip version and the
|
|
19
|
+
* local wall-clock — 1 day. Anything above is rejected as an exploit
|
|
20
|
+
* attempt (see {@link Cluster.mergeMember} for the full walkthrough).
|
|
21
|
+
*
|
|
22
|
+
* Tuned generous-but-finite: a legitimate node with a 23-hour clock
|
|
23
|
+
* skew still merges; a node claiming `version: Number.MAX_SAFE_INTEGER`
|
|
24
|
+
* (≈ 285 000 years above now) is rejected on the spot.
|
|
25
|
+
*/
|
|
26
|
+
const MAX_VERSION_SKEW_MS = 24 * 60 * 60 * 1_000;
|
|
27
|
+
/**
|
|
28
|
+
* The Cluster is a single-instance "extension" attached to an ActorSystem.
|
|
29
|
+
* It owns a Transport, a gossip-based membership view, a failure detector
|
|
30
|
+
* and the plumbing that dispatches inbound envelope messages to local actors.
|
|
31
|
+
*/
|
|
32
|
+
export class Cluster {
|
|
33
|
+
selfAddress;
|
|
34
|
+
selfRoles;
|
|
35
|
+
system;
|
|
36
|
+
transport;
|
|
37
|
+
log;
|
|
38
|
+
members = new Map();
|
|
39
|
+
failureDetector;
|
|
40
|
+
gossipIntervalMs;
|
|
41
|
+
seedRetryIntervalMs;
|
|
42
|
+
seedAddrs = [];
|
|
43
|
+
tombstoneTtlMs;
|
|
44
|
+
tombstonePruneIntervalMs;
|
|
45
|
+
tombstoneMinRetentionMs;
|
|
46
|
+
heartbeatSeq = 0;
|
|
47
|
+
gossipTimer = null;
|
|
48
|
+
heartbeatTimer = null;
|
|
49
|
+
fdTimer = null;
|
|
50
|
+
seedTimer = null;
|
|
51
|
+
weaklyUpTimer = null;
|
|
52
|
+
tombstonePruneTimer = null;
|
|
53
|
+
currentLeader = none;
|
|
54
|
+
weaklyUpAfterMs;
|
|
55
|
+
envelopeHandler = null;
|
|
56
|
+
_envelopeHandlersByPath = new Map();
|
|
57
|
+
wireHandlers = new Map();
|
|
58
|
+
started = false;
|
|
59
|
+
downing;
|
|
60
|
+
/**
|
|
61
|
+
* Set of unreachable address keys observed at the last downing
|
|
62
|
+
* evaluation. We only re-invoke the provider when the set
|
|
63
|
+
* actually changes — without this debounce a steady "always one
|
|
64
|
+
* unreachable peer" state would call `decide()` on every tick.
|
|
65
|
+
*/
|
|
66
|
+
lastDownedView = null;
|
|
67
|
+
constructor(system, settings) {
|
|
68
|
+
this.system = system;
|
|
69
|
+
this.selfAddress = new NodeAddress(system.name, settings.host, settings.port);
|
|
70
|
+
this.selfRoles = new Set(settings.roles ?? []);
|
|
71
|
+
this.log = system.log.withSource(`cluster@${this.selfAddress}`);
|
|
72
|
+
this.transport = settings.transport ?? new TcpTransport(this.selfAddress, this.log);
|
|
73
|
+
const fdSettings = {
|
|
74
|
+
...defaultFailureDetectorSettings,
|
|
75
|
+
...(settings.failureDetector ?? {}),
|
|
76
|
+
};
|
|
77
|
+
this.failureDetector = new FailureDetector(fdSettings);
|
|
78
|
+
this.gossipIntervalMs = settings.gossipIntervalMs ?? DEFAULT_GOSSIP_INTERVAL_MS;
|
|
79
|
+
this.seedRetryIntervalMs = settings.seedRetryIntervalMs ?? DEFAULT_SEED_RETRY_INTERVAL_MS;
|
|
80
|
+
this.weaklyUpAfterMs = settings.weaklyUpAfterMs ?? 0;
|
|
81
|
+
this.downing = settings.downing ?? null;
|
|
82
|
+
this.tombstoneTtlMs = settings.tombstoneTtlMs ?? DEFAULT_TOMBSTONE_TTL_MS;
|
|
83
|
+
this.tombstonePruneIntervalMs = settings.tombstonePruneIntervalMs ?? DEFAULT_TOMBSTONE_PRUNE_INTERVAL_MS;
|
|
84
|
+
this.tombstoneMinRetentionMs =
|
|
85
|
+
settings.tombstoneMinRetentionMs ?? 6 * fdSettings.downAfterMs;
|
|
86
|
+
}
|
|
87
|
+
/** Entry point: start the cluster and attempt to contact seed nodes. */
|
|
88
|
+
static async join(system, settings) {
|
|
89
|
+
const cluster = new Cluster(system, settings);
|
|
90
|
+
await cluster._start(settings.seeds ?? []);
|
|
91
|
+
return cluster;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* One-call bootstrap — creates the {@link ActorSystem}, joins the
|
|
95
|
+
* cluster, starts the Receptionist, waits for `SelfUp`, and wires
|
|
96
|
+
* SIGTERM/SIGINT shutdown. The headline shape for the clustered
|
|
97
|
+
* case:
|
|
98
|
+
*
|
|
99
|
+
* ```ts
|
|
100
|
+
* const { system, cluster, shutdown } = await Cluster.bootstrap({ name: 'my-app' });
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* For full configuration knobs see {@link ClusterBootstrapOptions}.
|
|
104
|
+
* For the power-user path (own `ActorSystem.create`, own
|
|
105
|
+
* `Cluster.join`, own signal wiring) keep using those directly —
|
|
106
|
+
* this is purely additive sugar.
|
|
107
|
+
*
|
|
108
|
+
* The helper lives in `ClusterBootstrap.ts` and is loaded lazily
|
|
109
|
+
* here to avoid a static import cycle (`ClusterBootstrap` ↔
|
|
110
|
+
* `Cluster.join`).
|
|
111
|
+
*/
|
|
112
|
+
static async bootstrap(opts) {
|
|
113
|
+
const { bootstrapCluster } = await import('./ClusterBootstrap.js');
|
|
114
|
+
return bootstrapCluster(opts);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The cluster's sharding facade. Lazily constructs (and memoises) a
|
|
118
|
+
* single `ClusterSharding` instance per `ActorSystem` so callers can
|
|
119
|
+
* start regions inline:
|
|
120
|
+
*
|
|
121
|
+
* ```ts
|
|
122
|
+
* const region = cluster.sharding.start('cart', CartActor, {
|
|
123
|
+
* extractEntityId: (m) => m.entityId,
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* Equivalent to `ClusterSharding.get(cluster.system, cluster)` —
|
|
128
|
+
* which still works for callers that prefer the explicit form.
|
|
129
|
+
*/
|
|
130
|
+
get sharding() {
|
|
131
|
+
return ClusterSharding.get(this.system, this);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Subscribe to membership events. The listener is immediately replayed
|
|
135
|
+
* the current cluster state as a series of Member/SelfUp events so that
|
|
136
|
+
* late subscribers still see the world they joined.
|
|
137
|
+
*/
|
|
138
|
+
subscribe(listener) {
|
|
139
|
+
this._listeners.push(listener);
|
|
140
|
+
// Replay current state.
|
|
141
|
+
for (const m of this.members.values()) {
|
|
142
|
+
try {
|
|
143
|
+
listener(new MemberJoined(m));
|
|
144
|
+
}
|
|
145
|
+
catch { /* ignore */ }
|
|
146
|
+
if (m.status === 'up') {
|
|
147
|
+
try {
|
|
148
|
+
listener(new MemberUp(m));
|
|
149
|
+
}
|
|
150
|
+
catch { /* ignore */ }
|
|
151
|
+
if (m.address.equals(this.selfAddress)) {
|
|
152
|
+
try {
|
|
153
|
+
listener(new SelfUp(m));
|
|
154
|
+
}
|
|
155
|
+
catch { /* ignore */ }
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (this.currentLeader.isSome()) {
|
|
160
|
+
try {
|
|
161
|
+
listener(new LeaderChanged(this.currentLeader));
|
|
162
|
+
}
|
|
163
|
+
catch { /* ignore */ }
|
|
164
|
+
}
|
|
165
|
+
return () => {
|
|
166
|
+
const idx = this._listeners.indexOf(listener);
|
|
167
|
+
if (idx >= 0)
|
|
168
|
+
this._listeners.splice(idx, 1);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
_listeners = [];
|
|
172
|
+
/**
|
|
173
|
+
* Current snapshot of known members. `removed` entries are kept
|
|
174
|
+
* internally as tombstones (so stale gossip can't resurrect them
|
|
175
|
+
* via the merge path) but are filtered out here — the public
|
|
176
|
+
* contract is "members the cluster currently considers part of
|
|
177
|
+
* the topology".
|
|
178
|
+
*/
|
|
179
|
+
getMembers() {
|
|
180
|
+
return Array.from(this.members.values()).filter((m) => m.status !== 'removed');
|
|
181
|
+
}
|
|
182
|
+
/** Members in the `up` state, ordered by address — the "active set". */
|
|
183
|
+
upMembers() {
|
|
184
|
+
return Array.from(this.members.values())
|
|
185
|
+
.filter(m => m.status === 'up')
|
|
186
|
+
.sort((a, b) => a.address.compareTo(b.address));
|
|
187
|
+
}
|
|
188
|
+
/** Reachable members (up + joining + leaving). */
|
|
189
|
+
reachableMembers() {
|
|
190
|
+
return Array.from(this.members.values()).filter(m => m.isReachable());
|
|
191
|
+
}
|
|
192
|
+
/** Up members that carry the given role tag. */
|
|
193
|
+
upMembersWithRole(role) {
|
|
194
|
+
return this.upMembers().filter(m => m.hasRole(role));
|
|
195
|
+
}
|
|
196
|
+
/** The oldest up-member is the cluster leader (deterministic across nodes). */
|
|
197
|
+
leader() {
|
|
198
|
+
const ups = this.upMembers();
|
|
199
|
+
return ups.length > 0 ? some(ups[0]) : none;
|
|
200
|
+
}
|
|
201
|
+
/** True if this node is currently the leader. */
|
|
202
|
+
isLeader() {
|
|
203
|
+
return this.leader().exists((l) => l.address.equals(this.selfAddress));
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Register a handler for inbound user envelopes. Kept for backward
|
|
207
|
+
* compatibility — prefer `_registerEnvelopeHandler(path, handler)` which
|
|
208
|
+
* allows multiple extensions (ClusterSharding, DistributedPubSub, …) to
|
|
209
|
+
* share the envelope pipeline.
|
|
210
|
+
*/
|
|
211
|
+
_setEnvelopeHandler(handler) {
|
|
212
|
+
this.envelopeHandler = handler;
|
|
213
|
+
}
|
|
214
|
+
/** Route envelopes addressed to `path` to `handler`. Returns unsubscribe. */
|
|
215
|
+
_registerEnvelopeHandler(path, handler) {
|
|
216
|
+
this._envelopeHandlersByPath.set(path, handler);
|
|
217
|
+
return () => this._envelopeHandlersByPath.delete(path);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Send an envelope to a remote node. Used by RemoteActorRef and by the
|
|
221
|
+
* PubSub / Singleton extensions. Any `ActorRef` embedded in the user
|
|
222
|
+
* payload is rewritten to a `WireActorRef` marker here — this is the
|
|
223
|
+
* single chokepoint where every cross-node message leaves, so hooking
|
|
224
|
+
* the encode step once covers all paths (sharding, pub-sub, singleton,
|
|
225
|
+
* direct remote-ref). Receiving nodes decode in `handleEnvelope`.
|
|
226
|
+
*/
|
|
227
|
+
_sendEnvelope(to, env) {
|
|
228
|
+
const encoded = { ...env, body: encodeRefs(env.body, this.selfAddress) };
|
|
229
|
+
this.transport.send(to, encoded);
|
|
230
|
+
}
|
|
231
|
+
/** Register a handler for a specific wire-message discriminator. */
|
|
232
|
+
_onWire(kind, handler) {
|
|
233
|
+
this.wireHandlers.set(kind, handler);
|
|
234
|
+
return () => this.wireHandlers.delete(kind);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Operator-initiated force-down of a remote peer (#56). Mirrors the
|
|
238
|
+
* private `evaluateDowning` path: marks the peer `down`, emits the
|
|
239
|
+
* lifecycle events, tombstones with `removedAt` so stale gossip
|
|
240
|
+
* can't resurrect it, and tells the failure detector to forget it.
|
|
241
|
+
*
|
|
242
|
+
* Returns `true` if a member was found and downed, `false` if the
|
|
243
|
+
* address was unknown or already terminal (`down`/`removed`).
|
|
244
|
+
*
|
|
245
|
+
* Intended for operator tooling — the management HTTP endpoint
|
|
246
|
+
* `POST /cluster/down` calls this directly. Don't use it as a
|
|
247
|
+
* replacement for the failure detector / downing provider in normal
|
|
248
|
+
* flow; it's a manual override.
|
|
249
|
+
*/
|
|
250
|
+
down(addr) {
|
|
251
|
+
if (!this.started)
|
|
252
|
+
return false;
|
|
253
|
+
const key = typeof addr === 'string' ? addr : addr.toString();
|
|
254
|
+
const m = this.members.get(key);
|
|
255
|
+
if (!m)
|
|
256
|
+
return false;
|
|
257
|
+
if (m.status === 'down' || m.status === 'removed')
|
|
258
|
+
return false;
|
|
259
|
+
if (m.address.equals(this.selfAddress)) {
|
|
260
|
+
// Don't try to tombstone ourselves — that's `leave()`'s job.
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
const downed = m.withStatus('down');
|
|
264
|
+
this.updateMember(downed);
|
|
265
|
+
this.emit(new MemberDown(downed));
|
|
266
|
+
const removed = downed.withRemoved(Date.now());
|
|
267
|
+
this.members.set(key, removed);
|
|
268
|
+
this.failureDetector.forget(m.address);
|
|
269
|
+
this.emit(new MemberRemoved(removed));
|
|
270
|
+
this.log.info(`operator force-down: ${m.address}`);
|
|
271
|
+
return true;
|
|
272
|
+
}
|
|
273
|
+
/** Gracefully leave the cluster (broadcast `leave`, stop transport). */
|
|
274
|
+
async leave() {
|
|
275
|
+
if (!this.started)
|
|
276
|
+
return;
|
|
277
|
+
this.started = false;
|
|
278
|
+
const me = this.members.get(this.selfAddress.toString());
|
|
279
|
+
if (me) {
|
|
280
|
+
this.updateMember(me.withStatus('leaving'));
|
|
281
|
+
}
|
|
282
|
+
const leaveMsg = { t: 'leave', node: this.selfAddress.toJSON() };
|
|
283
|
+
const peers = this.reachableMembers().filter((m) => !m.address.equals(this.selfAddress));
|
|
284
|
+
this.log.debug(`leaving — sending leave to ${peers.length} reachable peer(s)`);
|
|
285
|
+
for (const m of peers)
|
|
286
|
+
this.transport.send(m.address, leaveMsg);
|
|
287
|
+
this.gossipTimer?.cancel();
|
|
288
|
+
this.heartbeatTimer?.cancel();
|
|
289
|
+
this.fdTimer?.cancel();
|
|
290
|
+
this.seedTimer?.cancel();
|
|
291
|
+
this.weaklyUpTimer?.cancel();
|
|
292
|
+
this.tombstonePruneTimer?.cancel();
|
|
293
|
+
await this.transport.shutdown();
|
|
294
|
+
}
|
|
295
|
+
/* ================================ Internal ================================ */
|
|
296
|
+
async _start(seeds) {
|
|
297
|
+
this.transport.setHandler((from, msg) => this.handleWire(from, msg));
|
|
298
|
+
await this.transport.start();
|
|
299
|
+
this.started = true;
|
|
300
|
+
// Self is "joining" initially; transitions to "up" once at least
|
|
301
|
+
// one peer has acknowledged us (or we are the seed). We seed
|
|
302
|
+
// the version with a wall-clock epoch (`Date.now()`) instead of
|
|
303
|
+
// a constant `1` so that, when this address is restarted after
|
|
304
|
+
// a graceful leave, the new incarnation's gossip out-versions
|
|
305
|
+
// the `removed` tombstone surviving on peers — that's what
|
|
306
|
+
// makes rejoin-after-leave converge cleanly (see the
|
|
307
|
+
// `existing.removed && incoming.version > existing.version`
|
|
308
|
+
// branch in `mergeMember`). Within a single incarnation
|
|
309
|
+
// version is still a monotonically-increasing logical clock;
|
|
310
|
+
// the epoch only ensures a fresh process starts above any
|
|
311
|
+
// version that previous incarnation could have reached.
|
|
312
|
+
const me = new Member(this.selfAddress, 'joining', Date.now(), this.selfRoles);
|
|
313
|
+
this.members.set(me.address.toString(), me);
|
|
314
|
+
this.emit(new MemberJoined(me));
|
|
315
|
+
this.log.debug(`self joining: epoch=v${me.version} roles=[${[...this.selfRoles].join(',')}]`);
|
|
316
|
+
for (const s of seeds) {
|
|
317
|
+
const a = NodeAddress.parse(s.includes('@') ? s : `${this.system.name}@${s}`);
|
|
318
|
+
if (!a.equals(this.selfAddress))
|
|
319
|
+
this.seedAddrs.push(a);
|
|
320
|
+
}
|
|
321
|
+
if (this.seedAddrs.length === 0) {
|
|
322
|
+
// No seeds — we are the first node. Become Up immediately.
|
|
323
|
+
this.log.debug('no seeds configured — self-electing as first cluster member');
|
|
324
|
+
this.updateMember(me.withStatus('up'));
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
this.log.debug(`contacting ${this.seedAddrs.length} seed(s): [${this.seedAddrs.map((a) => a.toString()).join(',')}]`);
|
|
328
|
+
this.contactSeeds();
|
|
329
|
+
// Keep retrying seed contact until self has transitioned to up,
|
|
330
|
+
// covering the case where a seed hasn't started yet.
|
|
331
|
+
this.seedTimer = this.system.scheduler.scheduleAtFixedRateFn(this.seedRetryIntervalMs, this.seedRetryIntervalMs, () => {
|
|
332
|
+
const self = this.members.get(this.selfAddress.toString());
|
|
333
|
+
if (!self || self.status !== 'joining') {
|
|
334
|
+
this.seedTimer?.cancel();
|
|
335
|
+
this.seedTimer = null;
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
this.contactSeeds();
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
// Schedule automatic joining→weakly-up promotion if configured.
|
|
342
|
+
if (this.weaklyUpAfterMs > 0) {
|
|
343
|
+
this.weaklyUpTimer = this.system.scheduler.scheduleOnceFn(this.weaklyUpAfterMs, () => {
|
|
344
|
+
const me = this.members.get(this.selfAddress.toString());
|
|
345
|
+
if (me?.status === 'joining') {
|
|
346
|
+
this.updateMember(me.withStatus('weakly-up'));
|
|
347
|
+
}
|
|
348
|
+
this.weaklyUpTimer = null;
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
this.gossipTimer = this.system.scheduler.scheduleAtFixedRateFn(this.gossipIntervalMs, this.gossipIntervalMs, () => this.gossipTick());
|
|
352
|
+
this.heartbeatTimer = this.system.scheduler.scheduleAtFixedRateFn(this.failureDetector.interval, this.failureDetector.interval, () => this.heartbeatTick());
|
|
353
|
+
this.fdTimer = this.system.scheduler.scheduleAtFixedRateFn(this.failureDetector.interval, this.failureDetector.interval, () => this.failureDetectionTick());
|
|
354
|
+
this.tombstonePruneTimer = this.system.scheduler.scheduleAtFixedRateFn(this.tombstonePruneIntervalMs, this.tombstonePruneIntervalMs, () => this.tombstonePruneTick());
|
|
355
|
+
}
|
|
356
|
+
contactSeeds() {
|
|
357
|
+
const me = this.members.get(this.selfAddress.toString());
|
|
358
|
+
if (!me)
|
|
359
|
+
return;
|
|
360
|
+
for (const seed of this.seedAddrs) {
|
|
361
|
+
this.failureDetector.register(seed);
|
|
362
|
+
const initialGossip = {
|
|
363
|
+
t: 'gossip',
|
|
364
|
+
from: this.selfAddress.toJSON(),
|
|
365
|
+
members: [me.toData()],
|
|
366
|
+
};
|
|
367
|
+
this.transport.send(seed, initialGossip);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
handleWire(from, msg) {
|
|
371
|
+
this.failureDetector.heartbeat(from);
|
|
372
|
+
match(msg)
|
|
373
|
+
.with({ t: 'heartbeat' }, (m) => this.handleHeartbeat(from, m))
|
|
374
|
+
.with({ t: 'heartbeat-ack' }, () => { })
|
|
375
|
+
.with({ t: 'gossip' }, (m) => this.handleGossip(m))
|
|
376
|
+
.with({ t: 'envelope' }, (m) => this.handleEnvelope(from, m))
|
|
377
|
+
.with({ t: 'leave' }, (m) => this.handleLeave(m))
|
|
378
|
+
.otherwise(() => {
|
|
379
|
+
// 'shard-map' and any custom extension wire-msgs handled by the
|
|
380
|
+
// registry; we intentionally fall through when no handler is set.
|
|
381
|
+
const custom = this.wireHandlers.get(msg.t);
|
|
382
|
+
if (custom)
|
|
383
|
+
custom(msg, from);
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
handleHeartbeat(_from, msg) {
|
|
387
|
+
const peer = NodeAddress.fromJSON(msg.from);
|
|
388
|
+
this.failureDetector.heartbeat(peer);
|
|
389
|
+
// Reply isn't strictly needed because send() also bumps the detector,
|
|
390
|
+
// but it keeps symmetric latency information.
|
|
391
|
+
this.transport.send(peer, { t: 'heartbeat-ack', from: this.selfAddress.toJSON(), seq: msg.seq });
|
|
392
|
+
// If the peer was unreachable and we see traffic again, flip it back.
|
|
393
|
+
const existing = this.members.get(peer.toString());
|
|
394
|
+
if (existing && existing.status === 'unreachable') {
|
|
395
|
+
this.updateMember(existing.withStatus('up'));
|
|
396
|
+
this.emit(new MemberReachable(this.members.get(peer.toString())));
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
handleGossip(msg) {
|
|
400
|
+
const sender = NodeAddress.fromJSON(msg.from);
|
|
401
|
+
this.failureDetector.heartbeat(sender);
|
|
402
|
+
this.log.debug(`gossip from ${sender}: ${msg.members.length} member(s)`);
|
|
403
|
+
for (const data of msg.members) {
|
|
404
|
+
this.mergeMember(data);
|
|
405
|
+
}
|
|
406
|
+
// Ensure we know about the sender itself.
|
|
407
|
+
if (!this.members.has(sender.toString())) {
|
|
408
|
+
const m = new Member(sender, 'joining', 1);
|
|
409
|
+
this.members.set(sender.toString(), m);
|
|
410
|
+
this.emit(new MemberJoined(m));
|
|
411
|
+
}
|
|
412
|
+
// Leader promotes joining (and weakly-up) members to up.
|
|
413
|
+
if (this.isLeader()) {
|
|
414
|
+
for (const m of this.members.values()) {
|
|
415
|
+
if (m.status === 'joining' || m.status === 'weakly-up') {
|
|
416
|
+
this.log.debug(`leader-promote: ${m.address} ${m.status}→up`);
|
|
417
|
+
this.updateMember(m.withStatus('up'));
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
handleEnvelope(from, msg) {
|
|
423
|
+
// Re-install the originating MDC + active trace context for the
|
|
424
|
+
// duration of dispatch (#53, #10). Local refs that the
|
|
425
|
+
// dispatcher subsequently `tell`s capture this same context onto
|
|
426
|
+
// the next envelope, so both trails keep flowing across hops.
|
|
427
|
+
// Empty / missing contexts skip the corresponding wrapper.
|
|
428
|
+
let dispatch = () => this.dispatchEnvelope(from, msg);
|
|
429
|
+
// Tracing: if the envelope carries a parent context, open a
|
|
430
|
+
// `cluster.envelope.received` span so the trace explicitly
|
|
431
|
+
// shows the network hop and downstream local-tells see this
|
|
432
|
+
// span as their active parent.
|
|
433
|
+
if (msg.trace) {
|
|
434
|
+
const tracer = tracerOf(this.system);
|
|
435
|
+
const parentCtx = tracer.extractContext(msg.trace);
|
|
436
|
+
if (parentCtx) {
|
|
437
|
+
const inner = dispatch;
|
|
438
|
+
dispatch = () => {
|
|
439
|
+
const span = tracer.startSpan('cluster.envelope.received', {
|
|
440
|
+
parent: parentCtx,
|
|
441
|
+
kind: 'consumer',
|
|
442
|
+
attributes: {
|
|
443
|
+
'cluster.from': from.toString(),
|
|
444
|
+
'cluster.to.path': msg.to,
|
|
445
|
+
},
|
|
446
|
+
});
|
|
447
|
+
try {
|
|
448
|
+
tracer.withActiveSpan(span, inner);
|
|
449
|
+
}
|
|
450
|
+
finally {
|
|
451
|
+
span.end();
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (msg.context && Object.keys(msg.context).length > 0) {
|
|
457
|
+
LogContext.run(msg.context, dispatch);
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
dispatch();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
dispatchEnvelope(from, msg) {
|
|
464
|
+
// Rehydrate any ActorRef markers embedded in the user payload before
|
|
465
|
+
// handing it off — downstream handlers (sharding, pubsub, …) just
|
|
466
|
+
// forward `env.body` and shouldn't each duplicate the decode step.
|
|
467
|
+
const decoded = { ...msg, body: decodeRefs(msg.body, this) };
|
|
468
|
+
// 1. Explicit per-path handler (pub-sub mediator, singleton manager,
|
|
469
|
+
// sharding coordinator, …).
|
|
470
|
+
const perPath = this._envelopeHandlersByPath.get(msg.to);
|
|
471
|
+
if (perPath) {
|
|
472
|
+
perPath(decoded, from);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
// 2. Resolve the target path locally and deliver directly — covers the
|
|
476
|
+
// case where a RemoteActorRef rebuilt from a WireActorRef targets an
|
|
477
|
+
// arbitrary user-spawned actor (no extension routing). This also
|
|
478
|
+
// happens to be functionally identical to sharding's own
|
|
479
|
+
// dispatchEnvelope for region paths (both end in `ref.tell(body)`).
|
|
480
|
+
const segs = parsePathSegments(decoded.to);
|
|
481
|
+
if (segs.length > 0) {
|
|
482
|
+
const refOpt = this.system._resolvePath(segs);
|
|
483
|
+
if (refOpt.isSome()) {
|
|
484
|
+
refOpt.value.tell(decoded.body);
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
// 3. Catch-all — kept for backward-compat with legacy handlers.
|
|
489
|
+
if (this.envelopeHandler) {
|
|
490
|
+
this.envelopeHandler(decoded, from);
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
this.log.warn(`no envelope handler registered, dropping message to ${msg.to}`);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
handleLeave(msg) {
|
|
497
|
+
const peer = NodeAddress.fromJSON(msg.node);
|
|
498
|
+
const existing = this.members.get(peer.toString());
|
|
499
|
+
if (!existing)
|
|
500
|
+
return;
|
|
501
|
+
this.log.debug(`peer ${peer} sent leave — tombstoning (was ${existing.status} v${existing.version})`);
|
|
502
|
+
const leaving = existing.withStatus('leaving');
|
|
503
|
+
const removed = leaving.withRemoved(Date.now());
|
|
504
|
+
// Tombstone (don't delete) so a stale `up` gossip from a peer that
|
|
505
|
+
// hasn't seen the leave yet can't resurrect this address —
|
|
506
|
+
// `mergeMember`'s version check filters it out. Public APIs
|
|
507
|
+
// (`getMembers`, `upMembers`, `reachableMembers`) all skip
|
|
508
|
+
// `removed` entries. The `removedAt` stamp is what
|
|
509
|
+
// `tombstonePruneTick` uses to drop the entry once `tombstoneTtlMs`
|
|
510
|
+
// has elapsed (#75).
|
|
511
|
+
this.members.set(peer.toString(), removed);
|
|
512
|
+
this.failureDetector.forget(peer);
|
|
513
|
+
this.emit(new MemberLeft(leaving));
|
|
514
|
+
this.emit(new MemberRemoved(removed));
|
|
515
|
+
this.maybeEmitLeaderChange();
|
|
516
|
+
}
|
|
517
|
+
gossipTick() {
|
|
518
|
+
const targets = this.reachableMembers().filter(m => !m.address.equals(this.selfAddress));
|
|
519
|
+
if (targets.length === 0)
|
|
520
|
+
return;
|
|
521
|
+
// Push to one random reachable peer each tick — epidemic style.
|
|
522
|
+
const target = targets[Math.floor(Math.random() * targets.length)];
|
|
523
|
+
const gossip = {
|
|
524
|
+
t: 'gossip',
|
|
525
|
+
from: this.selfAddress.toJSON(),
|
|
526
|
+
members: Array.from(this.members.values()).map(m => m.toData()),
|
|
527
|
+
};
|
|
528
|
+
this.transport.send(target.address, gossip);
|
|
529
|
+
// Stock metric: gossip rounds count.
|
|
530
|
+
metricsOf(this.system).counter('cluster_gossip_rounds_total', {}, { help: 'Cumulative count of gossip-push rounds initiated by this node.' }).inc();
|
|
531
|
+
}
|
|
532
|
+
heartbeatTick() {
|
|
533
|
+
this.heartbeatSeq++;
|
|
534
|
+
const hb = {
|
|
535
|
+
t: 'heartbeat',
|
|
536
|
+
from: this.selfAddress.toJSON(),
|
|
537
|
+
seq: this.heartbeatSeq,
|
|
538
|
+
ts: Date.now(),
|
|
539
|
+
};
|
|
540
|
+
for (const m of this.reachableMembers()) {
|
|
541
|
+
if (m.address.equals(this.selfAddress))
|
|
542
|
+
continue;
|
|
543
|
+
this.transport.send(m.address, hb);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
failureDetectionTick() {
|
|
547
|
+
for (const m of Array.from(this.members.values())) {
|
|
548
|
+
if (m.address.equals(this.selfAddress))
|
|
549
|
+
continue;
|
|
550
|
+
const decision = this.failureDetector.decide(m.address);
|
|
551
|
+
if (decision === 'unreachable' && m.status === 'up') {
|
|
552
|
+
this.log.debug(`FD: ${m.address} → unreachable (heartbeat timeout)`);
|
|
553
|
+
this.updateMember(m.withStatus('unreachable'));
|
|
554
|
+
this.emit(new MemberUnreachable(this.members.get(m.address.toString())));
|
|
555
|
+
}
|
|
556
|
+
else if (decision === 'down' && m.status !== 'down' && m.status !== 'removed') {
|
|
557
|
+
this.log.debug(`FD: ${m.address} → down (was ${m.status}); deleting from membership`);
|
|
558
|
+
const downed = m.withStatus('down');
|
|
559
|
+
this.updateMember(downed);
|
|
560
|
+
this.emit(new MemberDown(downed));
|
|
561
|
+
// Note: FD-driven downing is the *advisory* fallback when no
|
|
562
|
+
// `DowningProvider` is configured. We delete here (rather
|
|
563
|
+
// than tombstone) so a partition followed by a heal can
|
|
564
|
+
// recover the peer — `partition+heal` semantics rely on
|
|
565
|
+
// this. Definitive downing paths (`handleLeave`,
|
|
566
|
+
// `evaluateDowning` force-down) tombstone instead, which
|
|
567
|
+
// prevents stale gossip from resurrecting the address.
|
|
568
|
+
this.members.delete(m.address.toString());
|
|
569
|
+
this.failureDetector.forget(m.address);
|
|
570
|
+
// Transient `removed` Member only used for the event emit —
|
|
571
|
+
// not stored, so the missing `removedAt` here is intentional.
|
|
572
|
+
const removed = downed.withStatus('removed');
|
|
573
|
+
this.emit(new MemberRemoved(removed));
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
// Optional split-brain resolver — runs after the failure-detector
|
|
577
|
+
// pass so it sees the latest unreachable set.
|
|
578
|
+
if (this.downing)
|
|
579
|
+
this.evaluateDowning();
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Build a `ClusterPartitionView` from the current member set and
|
|
583
|
+
* ask the configured `DowningProvider` to decide which addresses
|
|
584
|
+
* (if any) need to be force-downed. Debounces by the JSON shape of
|
|
585
|
+
* the unreachable set + member view so a steady-state cluster
|
|
586
|
+
* doesn't re-invoke the provider on every tick.
|
|
587
|
+
*/
|
|
588
|
+
evaluateDowning() {
|
|
589
|
+
if (!this.downing)
|
|
590
|
+
return;
|
|
591
|
+
const allMembers = Array.from(this.members.values());
|
|
592
|
+
const unreachable = new Set(allMembers
|
|
593
|
+
.filter((m) => m.status === 'unreachable')
|
|
594
|
+
.map((m) => m.address.toString()));
|
|
595
|
+
// Cheap fingerprint — re-evaluate only when membership or
|
|
596
|
+
// reachability shifts. The fingerprint includes statuses so a
|
|
597
|
+
// change like "leaving → unreachable" also triggers a re-check.
|
|
598
|
+
const fingerprint = allMembers
|
|
599
|
+
.map((m) => `${m.address.toString()}:${m.status}`)
|
|
600
|
+
.sort()
|
|
601
|
+
.join('|');
|
|
602
|
+
// Debounce only when the LAST evaluation produced an applied
|
|
603
|
+
// decision. Strategies that need multiple ticks to converge
|
|
604
|
+
// (e.g. `LeaseMajority` with an in-flight `acquire()`) will
|
|
605
|
+
// return an empty set on the first call and a real decision on
|
|
606
|
+
// a later call WITH THE SAME FINGERPRINT — we must keep
|
|
607
|
+
// re-asking them. `lastDownedView === null` means "nothing
|
|
608
|
+
// committed yet", so we evaluate.
|
|
609
|
+
if (this.lastDownedView !== null && fingerprint === this.lastDownedView)
|
|
610
|
+
return;
|
|
611
|
+
const view = {
|
|
612
|
+
allMembers,
|
|
613
|
+
unreachable,
|
|
614
|
+
self: this.selfAddress,
|
|
615
|
+
};
|
|
616
|
+
let toDown;
|
|
617
|
+
try {
|
|
618
|
+
toDown = this.downing.decide(view);
|
|
619
|
+
}
|
|
620
|
+
catch (err) {
|
|
621
|
+
this.log.warn(`downing provider threw — treating as no decision`, err);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
if (toDown.size === 0)
|
|
625
|
+
return;
|
|
626
|
+
this.lastDownedView = fingerprint;
|
|
627
|
+
const selfKey = this.selfAddress.toString();
|
|
628
|
+
const downsSelf = toDown.has(selfKey);
|
|
629
|
+
for (const key of toDown) {
|
|
630
|
+
// Self gets handled via `leave()` below — it gossips a Leaving
|
|
631
|
+
// notice to peers + drains the transport cleanly, which is
|
|
632
|
+
// strictly better than just deleting ourselves out of our own
|
|
633
|
+
// member map.
|
|
634
|
+
if (key === selfKey)
|
|
635
|
+
continue;
|
|
636
|
+
const m = this.members.get(key);
|
|
637
|
+
if (!m)
|
|
638
|
+
continue;
|
|
639
|
+
if (m.status === 'down' || m.status === 'removed')
|
|
640
|
+
continue;
|
|
641
|
+
const downed = m.withStatus('down');
|
|
642
|
+
this.updateMember(downed);
|
|
643
|
+
this.emit(new MemberDown(downed));
|
|
644
|
+
// Tombstone (don't delete) so later gossip from peers that
|
|
645
|
+
// haven't seen the force-down can't resurrect this address.
|
|
646
|
+
// `removedAt` lets `tombstonePruneTick` reclaim the entry
|
|
647
|
+
// after `tombstoneTtlMs` (#75).
|
|
648
|
+
const removed = downed.withRemoved(Date.now());
|
|
649
|
+
this.members.set(key, removed);
|
|
650
|
+
this.failureDetector.forget(m.address);
|
|
651
|
+
this.emit(new MemberRemoved(removed));
|
|
652
|
+
}
|
|
653
|
+
if (downsSelf) {
|
|
654
|
+
void this.leave().catch((e) => this.log.warn(`self-leave after downing decision failed`, e));
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
mergeMember(data) {
|
|
658
|
+
const incoming = Member.fromData(data);
|
|
659
|
+
// Security: reject versions that are absurdly far in the future.
|
|
660
|
+
//
|
|
661
|
+
// **Exploit walkthrough (pre-fix).** Versions are seeded from
|
|
662
|
+
// `Date.now()` and bumped by 1 on status transitions — in normal
|
|
663
|
+
// operation they stay within ~`Date.now() + small N`. Nothing
|
|
664
|
+
// capped them before, so a malicious peer could gossip with
|
|
665
|
+
// `version: Number.MAX_SAFE_INTEGER` for any target. The merge
|
|
666
|
+
// accepted it (higher than the existing version → win), and
|
|
667
|
+
// every legitimate update from that target was rejected
|
|
668
|
+
// afterward (`<= MAX_SAFE_INTEGER` always true). Effect:
|
|
669
|
+
// permanent DoS — the target was pinned to whatever status the
|
|
670
|
+
// attacker chose, with no way to recover. In JS,
|
|
671
|
+
// `MAX_SAFE_INTEGER + 1` rounds back to itself, so even fresh
|
|
672
|
+
// start-from-zero re-incarnation couldn't escape.
|
|
673
|
+
//
|
|
674
|
+
// Cap at `now + MAX_VERSION_SKEW_MS` (1 day) — generous enough
|
|
675
|
+
// for any real clock skew, tight enough that MAX_SAFE_INTEGER
|
|
676
|
+
// (≈ 285 000 years above now) is rejected immediately.
|
|
677
|
+
const maxAcceptableVersion = Date.now() + MAX_VERSION_SKEW_MS;
|
|
678
|
+
if (!Number.isFinite(incoming.version) || incoming.version > maxAcceptableVersion) {
|
|
679
|
+
this.log.warn(`merge: rejecting gossip from ${incoming.address} with implausible version ` +
|
|
680
|
+
`${incoming.version} (max acceptable ${maxAcceptableVersion}) — possible exploit`);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
// Reject expired tombstones from gossip — peers that haven't yet
|
|
684
|
+
// pruned a long-dead address would otherwise resurrect it on
|
|
685
|
+
// nodes that already pruned (#75). Old nodes that pre-date the
|
|
686
|
+
// `removedAt` field gossip without it; we treat such tombstones
|
|
687
|
+
// as fresh (no age info ⇒ assume they need normal TTL) so a
|
|
688
|
+
// mixed-version cluster still converges.
|
|
689
|
+
if (incoming.status === 'removed'
|
|
690
|
+
&& incoming.removedAt !== undefined
|
|
691
|
+
&& Date.now() - incoming.removedAt >= this.tombstoneTtlMs) {
|
|
692
|
+
this.log.debug(`merge: dropping expired tombstone for ${incoming.address} ` +
|
|
693
|
+
`(age ${Date.now() - incoming.removedAt}ms ≥ ttl ${this.tombstoneTtlMs}ms)`);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const existing = this.members.get(incoming.address.toString());
|
|
697
|
+
if (!existing) {
|
|
698
|
+
this.members.set(incoming.address.toString(), incoming);
|
|
699
|
+
this.failureDetector.register(incoming.address);
|
|
700
|
+
this.emit(new MemberJoined(incoming));
|
|
701
|
+
// If we first learn about the member already in a terminal or
|
|
702
|
+
// active state (common via gossip merging), also fire the matching
|
|
703
|
+
// status event so subscribers (ShardRegion, etc.) re-allocate.
|
|
704
|
+
if (incoming.status !== 'joining') {
|
|
705
|
+
this.emitStatusTransition(new Member(incoming.address, 'joining', 0), incoming);
|
|
706
|
+
}
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
// Re-incarnation: a previously-removed (tombstoned) address can
|
|
710
|
+
// be revived by a fresh start on the same `host:port`. We
|
|
711
|
+
// detect the new incarnation by its strictly higher base
|
|
712
|
+
// version: each `Cluster.join` seeds its self-member with a
|
|
713
|
+
// wall-clock-based epoch (see `_start`), so any state the new
|
|
714
|
+
// node reports — directly via its initial gossip OR indirectly
|
|
715
|
+
// via a peer that has already seen the rejoin — out-versions
|
|
716
|
+
// the tombstone left over from its previous run. Drop the
|
|
717
|
+
// tombstone, treat the address as a fresh member, and emit the
|
|
718
|
+
// matching status event so subscribers (ShardRegion, etc.)
|
|
719
|
+
// re-allocate. Without this branch, `mergeMember`'s strict
|
|
720
|
+
// version monotonicity below would pin the address to
|
|
721
|
+
// `removed` forever even though the higher version is the
|
|
722
|
+
// newer truth.
|
|
723
|
+
if (existing.status === 'removed' && incoming.version > existing.version) {
|
|
724
|
+
this.log.debug(`merge: ${incoming.address} re-incarnation (was removed v${existing.version}, now ${incoming.status} v${incoming.version})`);
|
|
725
|
+
this.members.set(incoming.address.toString(), incoming);
|
|
726
|
+
this.failureDetector.register(incoming.address);
|
|
727
|
+
this.emit(new MemberJoined(incoming));
|
|
728
|
+
if (incoming.status !== 'joining') {
|
|
729
|
+
this.emitStatusTransition(new Member(incoming.address, 'joining', 0), incoming);
|
|
730
|
+
}
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
if (incoming.version <= existing.version)
|
|
734
|
+
return; // older or equal, ignore
|
|
735
|
+
if (existing.status !== incoming.status) {
|
|
736
|
+
this.log.debug(`merge: ${incoming.address} ${existing.status}→${incoming.status} (v${existing.version}→v${incoming.version})`);
|
|
737
|
+
}
|
|
738
|
+
this.members.set(incoming.address.toString(), incoming);
|
|
739
|
+
this.emitStatusTransition(existing, incoming);
|
|
740
|
+
}
|
|
741
|
+
updateMember(next) {
|
|
742
|
+
const key = next.address.toString();
|
|
743
|
+
const prev = this.members.get(key);
|
|
744
|
+
this.members.set(key, next);
|
|
745
|
+
if (prev)
|
|
746
|
+
this.emitStatusTransition(prev, next);
|
|
747
|
+
else
|
|
748
|
+
this.emit(new MemberJoined(next));
|
|
749
|
+
// Stock metric: members-up gauge. Updated on every member-set
|
|
750
|
+
// mutation so all transitions (join, up, down, removed) keep it
|
|
751
|
+
// current. Single value per node — labels are deliberately empty
|
|
752
|
+
// because the gauge is always the local view's snapshot.
|
|
753
|
+
metricsOf(this.system).gauge('cluster_members_up', {}, { help: 'Number of cluster members currently in `up` state.' }).set(this.upMembers().length);
|
|
754
|
+
}
|
|
755
|
+
emitStatusTransition(prev, next) {
|
|
756
|
+
if (prev.status === next.status)
|
|
757
|
+
return;
|
|
758
|
+
match(next.status)
|
|
759
|
+
.with('up', () => {
|
|
760
|
+
this.emit(new MemberUp(next));
|
|
761
|
+
if (next.address.equals(this.selfAddress))
|
|
762
|
+
this.emit(new SelfUp(next));
|
|
763
|
+
})
|
|
764
|
+
.with('weakly-up', () => this.emit(new MemberWeaklyUp(next)))
|
|
765
|
+
.with('unreachable', () => this.emit(new MemberUnreachable(next)))
|
|
766
|
+
.with('down', () => this.emit(new MemberDown(next)))
|
|
767
|
+
.with('leaving', () => this.emit(new MemberLeft(next)))
|
|
768
|
+
.with('removed', () => {
|
|
769
|
+
this.emit(new MemberRemoved(next));
|
|
770
|
+
if (next.address.equals(this.selfAddress))
|
|
771
|
+
this.emit(new SelfRemoved(next));
|
|
772
|
+
})
|
|
773
|
+
.with('joining', () => { })
|
|
774
|
+
.exhaustive();
|
|
775
|
+
this.maybeEmitLeaderChange();
|
|
776
|
+
}
|
|
777
|
+
maybeEmitLeaderChange() {
|
|
778
|
+
const newLeader = this.leader();
|
|
779
|
+
const prev = this.currentLeader;
|
|
780
|
+
const changed = prev.isSome() !== newLeader.isSome()
|
|
781
|
+
|| (prev.isSome() && newLeader.isSome() && !prev.value.address.equals(newLeader.value.address));
|
|
782
|
+
if (changed) {
|
|
783
|
+
this.currentLeader = newLeader;
|
|
784
|
+
const prevStr = prev.fold(() => 'none', (m) => m.address.toString());
|
|
785
|
+
const nextStr = newLeader.fold(() => 'none', (m) => m.address.toString());
|
|
786
|
+
this.log.debug(`leader changed: ${prevStr} → ${nextStr}`);
|
|
787
|
+
this.emit(new LeaderChanged(newLeader));
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
emit(event) {
|
|
791
|
+
this.system.eventStream.publish(event);
|
|
792
|
+
for (const l of this._listeners) {
|
|
793
|
+
try {
|
|
794
|
+
l(event);
|
|
795
|
+
}
|
|
796
|
+
catch (e) {
|
|
797
|
+
this.log.warn('listener threw', e);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Drop tombstones whose `removedAt` exceeds `tombstoneTtlMs` (and
|
|
803
|
+
* the `tombstoneMinRetentionMs` floor). Each peer makes the same
|
|
804
|
+
* decision on its local clock — with TTL ≫ gossip propagation lag,
|
|
805
|
+
* peers prune within seconds of each other and stale-gossip
|
|
806
|
+
* resurrection is filtered out by `mergeMember`'s "expired
|
|
807
|
+
* tombstone" guard. See #75 for the full rationale.
|
|
808
|
+
*
|
|
809
|
+
* Tombstones lacking `removedAt` (older nodes pre-dating the field)
|
|
810
|
+
* are kept — we have no age info to compare against. They drop
|
|
811
|
+
* out naturally when those nodes are upgraded or restart.
|
|
812
|
+
*/
|
|
813
|
+
tombstonePruneTick() {
|
|
814
|
+
const now = Date.now();
|
|
815
|
+
const cutoff = Math.max(this.tombstoneTtlMs, this.tombstoneMinRetentionMs);
|
|
816
|
+
let pruned = 0;
|
|
817
|
+
for (const [key, m] of this.members) {
|
|
818
|
+
if (m.status !== 'removed')
|
|
819
|
+
continue;
|
|
820
|
+
if (m.removedAt === undefined)
|
|
821
|
+
continue;
|
|
822
|
+
if (now - m.removedAt < cutoff)
|
|
823
|
+
continue;
|
|
824
|
+
this.members.delete(key);
|
|
825
|
+
pruned++;
|
|
826
|
+
}
|
|
827
|
+
if (pruned > 0) {
|
|
828
|
+
this.log.debug(`tombstone prune: dropped ${pruned} expired entr${pruned === 1 ? 'y' : 'ies'} ` +
|
|
829
|
+
`(ttl=${this.tombstoneTtlMs}ms, minRetention=${this.tombstoneMinRetentionMs}ms)`);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
/** Helper — creates an InMemoryTransport for tests. */
|
|
834
|
+
export function inMemoryTransport(system, host, port) {
|
|
835
|
+
return new InMemoryTransport(new NodeAddress(system.name, host, port));
|
|
836
|
+
}
|
|
837
|
+
//# sourceMappingURL=Cluster.js.map
|