@effect/cluster 0.0.0-snapshot-d33d8b050b8e3c87dcde9587083e6c1cf733f72b
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/AtLeastOnce/package.json +6 -0
- package/AtLeastOnceStorage/package.json +6 -0
- package/Broadcaster/package.json +6 -0
- package/LICENSE +21 -0
- package/ManagerConfig/package.json +6 -0
- package/Message/package.json +6 -0
- package/MessageState/package.json +6 -0
- package/Messenger/package.json +6 -0
- package/Pod/package.json +6 -0
- package/PodAddress/package.json +6 -0
- package/Pods/package.json +6 -0
- package/PodsHealth/package.json +6 -0
- package/PoisonPill/package.json +6 -0
- package/README.md +3 -0
- package/RecipientAddress/package.json +6 -0
- package/RecipientBehaviour/package.json +6 -0
- package/RecipientBehaviourContext/package.json +6 -0
- package/RecipientType/package.json +6 -0
- package/Serialization/package.json +6 -0
- package/SerializedEnvelope/package.json +6 -0
- package/SerializedMessage/package.json +6 -0
- package/ShardId/package.json +6 -0
- package/ShardManager/package.json +6 -0
- package/ShardManagerClient/package.json +6 -0
- package/Sharding/package.json +6 -0
- package/ShardingConfig/package.json +6 -0
- package/ShardingEvent/package.json +6 -0
- package/ShardingException/package.json +6 -0
- package/ShardingRegistrationEvent/package.json +6 -0
- package/Storage/package.json +6 -0
- package/dist/cjs/AtLeastOnce.js +43 -0
- package/dist/cjs/AtLeastOnce.js.map +1 -0
- package/dist/cjs/AtLeastOnceStorage.js +48 -0
- package/dist/cjs/AtLeastOnceStorage.js.map +1 -0
- package/dist/cjs/Broadcaster.js +6 -0
- package/dist/cjs/Broadcaster.js.map +1 -0
- package/dist/cjs/ManagerConfig.js +57 -0
- package/dist/cjs/ManagerConfig.js.map +1 -0
- package/dist/cjs/Message.js +64 -0
- package/dist/cjs/Message.js.map +1 -0
- package/dist/cjs/MessageState.js +78 -0
- package/dist/cjs/MessageState.js.map +1 -0
- package/dist/cjs/Messenger.js +6 -0
- package/dist/cjs/Messenger.js.map +1 -0
- package/dist/cjs/Pod.js +101 -0
- package/dist/cjs/Pod.js.map +1 -0
- package/dist/cjs/PodAddress.js +100 -0
- package/dist/cjs/PodAddress.js.map +1 -0
- package/dist/cjs/Pods.js +58 -0
- package/dist/cjs/Pods.js.map +1 -0
- package/dist/cjs/PodsHealth.js +64 -0
- package/dist/cjs/PodsHealth.js.map +1 -0
- package/dist/cjs/PoisonPill.js +101 -0
- package/dist/cjs/PoisonPill.js.map +1 -0
- package/dist/cjs/RecipientAddress.js +102 -0
- package/dist/cjs/RecipientAddress.js.map +1 -0
- package/dist/cjs/RecipientBehaviour.js +61 -0
- package/dist/cjs/RecipientBehaviour.js.map +1 -0
- package/dist/cjs/RecipientBehaviourContext.js +87 -0
- package/dist/cjs/RecipientBehaviourContext.js.map +1 -0
- package/dist/cjs/RecipientType.js +142 -0
- package/dist/cjs/RecipientType.js.map +1 -0
- package/dist/cjs/Serialization.js +55 -0
- package/dist/cjs/Serialization.js.map +1 -0
- package/dist/cjs/SerializedEnvelope.js +111 -0
- package/dist/cjs/SerializedEnvelope.js.map +1 -0
- package/dist/cjs/SerializedMessage.js +87 -0
- package/dist/cjs/SerializedMessage.js.map +1 -0
- package/dist/cjs/ShardId.js +89 -0
- package/dist/cjs/ShardId.js.map +1 -0
- package/dist/cjs/ShardManager.js +48 -0
- package/dist/cjs/ShardManager.js.map +1 -0
- package/dist/cjs/ShardManagerClient.js +53 -0
- package/dist/cjs/ShardManagerClient.js.map +1 -0
- package/dist/cjs/Sharding.js +129 -0
- package/dist/cjs/Sharding.js.map +1 -0
- package/dist/cjs/ShardingConfig.js +64 -0
- package/dist/cjs/ShardingConfig.js.map +1 -0
- package/dist/cjs/ShardingEvent.js +72 -0
- package/dist/cjs/ShardingEvent.js.map +1 -0
- package/dist/cjs/ShardingException.js +130 -0
- package/dist/cjs/ShardingException.js.map +1 -0
- package/dist/cjs/ShardingRegistrationEvent.js +44 -0
- package/dist/cjs/ShardingRegistrationEvent.js.map +1 -0
- package/dist/cjs/Storage.js +63 -0
- package/dist/cjs/Storage.js.map +1 -0
- package/dist/cjs/index.js +88 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/internal/atLeastOnce.js +58 -0
- package/dist/cjs/internal/atLeastOnce.js.map +1 -0
- package/dist/cjs/internal/atLeastOnceStorage.js +186 -0
- package/dist/cjs/internal/atLeastOnceStorage.js.map +1 -0
- package/dist/cjs/internal/entityManager.js +191 -0
- package/dist/cjs/internal/entityManager.js.map +1 -0
- package/dist/cjs/internal/entityState.js +70 -0
- package/dist/cjs/internal/entityState.js.map +1 -0
- package/dist/cjs/internal/managerConfig.js +69 -0
- package/dist/cjs/internal/managerConfig.js.map +1 -0
- package/dist/cjs/internal/message.js +68 -0
- package/dist/cjs/internal/message.js.map +1 -0
- package/dist/cjs/internal/messageState.js +102 -0
- package/dist/cjs/internal/messageState.js.map +1 -0
- package/dist/cjs/internal/podWithMetadata.js +77 -0
- package/dist/cjs/internal/podWithMetadata.js.map +1 -0
- package/dist/cjs/internal/pods.js +58 -0
- package/dist/cjs/internal/pods.js.map +1 -0
- package/dist/cjs/internal/podsHealth.js +63 -0
- package/dist/cjs/internal/podsHealth.js.map +1 -0
- package/dist/cjs/internal/recipientBehaviour.js +75 -0
- package/dist/cjs/internal/recipientBehaviour.js.map +1 -0
- package/dist/cjs/internal/recipientBehaviourContext.js +59 -0
- package/dist/cjs/internal/recipientBehaviourContext.js.map +1 -0
- package/dist/cjs/internal/serialization.js +72 -0
- package/dist/cjs/internal/serialization.js.map +1 -0
- package/dist/cjs/internal/shardManager.js +291 -0
- package/dist/cjs/internal/shardManager.js.map +1 -0
- package/dist/cjs/internal/shardManagerClient.js +71 -0
- package/dist/cjs/internal/shardManagerClient.js.map +1 -0
- package/dist/cjs/internal/shardManagerState.js +67 -0
- package/dist/cjs/internal/shardManagerState.js.map +1 -0
- package/dist/cjs/internal/sharding.js +329 -0
- package/dist/cjs/internal/sharding.js.map +1 -0
- package/dist/cjs/internal/shardingConfig.js +79 -0
- package/dist/cjs/internal/shardingConfig.js.map +1 -0
- package/dist/cjs/internal/storage.js +75 -0
- package/dist/cjs/internal/storage.js.map +1 -0
- package/dist/cjs/internal/utils.js +92 -0
- package/dist/cjs/internal/utils.js.map +1 -0
- package/dist/dts/AtLeastOnce.d.ts +20 -0
- package/dist/dts/AtLeastOnce.d.ts.map +1 -0
- package/dist/dts/AtLeastOnceStorage.d.ts +75 -0
- package/dist/dts/AtLeastOnceStorage.d.ts.map +1 -0
- package/dist/dts/Broadcaster.d.ts +32 -0
- package/dist/dts/Broadcaster.d.ts.map +1 -0
- package/dist/dts/ManagerConfig.d.ts +61 -0
- package/dist/dts/ManagerConfig.d.ts.map +1 -0
- package/dist/dts/Message.d.ts +106 -0
- package/dist/dts/Message.d.ts.map +1 -0
- package/dist/dts/MessageState.d.ts +107 -0
- package/dist/dts/MessageState.d.ts.map +1 -0
- package/dist/dts/Messenger.d.ts +32 -0
- package/dist/dts/Messenger.d.ts.map +1 -0
- package/dist/dts/Pod.d.ts +81 -0
- package/dist/dts/Pod.d.ts.map +1 -0
- package/dist/dts/PodAddress.d.ts +80 -0
- package/dist/dts/PodAddress.d.ts.map +1 -0
- package/dist/dts/Pods.d.ts +78 -0
- package/dist/dts/Pods.d.ts.map +1 -0
- package/dist/dts/PodsHealth.d.ts +66 -0
- package/dist/dts/PodsHealth.d.ts.map +1 -0
- package/dist/dts/PoisonPill.d.ts +78 -0
- package/dist/dts/PoisonPill.d.ts.map +1 -0
- package/dist/dts/RecipientAddress.d.ts +57 -0
- package/dist/dts/RecipientAddress.d.ts.map +1 -0
- package/dist/dts/RecipientBehaviour.d.ts +72 -0
- package/dist/dts/RecipientBehaviour.d.ts.map +1 -0
- package/dist/dts/RecipientBehaviourContext.d.ts +83 -0
- package/dist/dts/RecipientBehaviourContext.d.ts.map +1 -0
- package/dist/dts/RecipientType.d.ts +96 -0
- package/dist/dts/RecipientType.d.ts.map +1 -0
- package/dist/dts/Serialization.d.ts +58 -0
- package/dist/dts/Serialization.d.ts.map +1 -0
- package/dist/dts/SerializedEnvelope.d.ts +87 -0
- package/dist/dts/SerializedEnvelope.d.ts.map +1 -0
- package/dist/dts/SerializedMessage.d.ts +66 -0
- package/dist/dts/SerializedMessage.d.ts.map +1 -0
- package/dist/dts/ShardId.d.ts +70 -0
- package/dist/dts/ShardId.d.ts.map +1 -0
- package/dist/dts/ShardManager.d.ts +44 -0
- package/dist/dts/ShardManager.d.ts.map +1 -0
- package/dist/dts/ShardManagerClient.d.ts +50 -0
- package/dist/dts/ShardManagerClient.d.ts.map +1 -0
- package/dist/dts/Sharding.d.ts +146 -0
- package/dist/dts/Sharding.d.ts.map +1 -0
- package/dist/dts/ShardingConfig.d.ts +69 -0
- package/dist/dts/ShardingConfig.d.ts.map +1 -0
- package/dist/dts/ShardingEvent.d.ts +90 -0
- package/dist/dts/ShardingEvent.d.ts.map +1 -0
- package/dist/dts/ShardingException.d.ts +125 -0
- package/dist/dts/ShardingException.d.ts.map +1 -0
- package/dist/dts/ShardingRegistrationEvent.d.ts +44 -0
- package/dist/dts/ShardingRegistrationEvent.d.ts.map +1 -0
- package/dist/dts/Storage.d.ts +78 -0
- package/dist/dts/Storage.d.ts.map +1 -0
- package/dist/dts/index.d.ts +113 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/internal/atLeastOnce.d.ts +2 -0
- package/dist/dts/internal/atLeastOnce.d.ts.map +1 -0
- package/dist/dts/internal/atLeastOnceStorage.d.ts +2 -0
- package/dist/dts/internal/atLeastOnceStorage.d.ts.map +1 -0
- package/dist/dts/internal/entityManager.d.ts +2 -0
- package/dist/dts/internal/entityManager.d.ts.map +1 -0
- package/dist/dts/internal/entityState.d.ts +21 -0
- package/dist/dts/internal/entityState.d.ts.map +1 -0
- package/dist/dts/internal/managerConfig.d.ts +2 -0
- package/dist/dts/internal/managerConfig.d.ts.map +1 -0
- package/dist/dts/internal/message.d.ts +9 -0
- package/dist/dts/internal/message.d.ts.map +1 -0
- package/dist/dts/internal/messageState.d.ts +2 -0
- package/dist/dts/internal/messageState.d.ts.map +1 -0
- package/dist/dts/internal/podWithMetadata.d.ts +2 -0
- package/dist/dts/internal/podWithMetadata.d.ts.map +1 -0
- package/dist/dts/internal/pods.d.ts +2 -0
- package/dist/dts/internal/pods.d.ts.map +1 -0
- package/dist/dts/internal/podsHealth.d.ts +2 -0
- package/dist/dts/internal/podsHealth.d.ts.map +1 -0
- package/dist/dts/internal/recipientBehaviour.d.ts +2 -0
- package/dist/dts/internal/recipientBehaviour.d.ts.map +1 -0
- package/dist/dts/internal/recipientBehaviourContext.d.ts +2 -0
- package/dist/dts/internal/recipientBehaviourContext.d.ts.map +1 -0
- package/dist/dts/internal/serialization.d.ts +2 -0
- package/dist/dts/internal/serialization.d.ts.map +1 -0
- package/dist/dts/internal/shardManager.d.ts +12 -0
- package/dist/dts/internal/shardManager.d.ts.map +1 -0
- package/dist/dts/internal/shardManagerClient.d.ts +2 -0
- package/dist/dts/internal/shardManagerClient.d.ts.map +1 -0
- package/dist/dts/internal/shardManagerState.d.ts +26 -0
- package/dist/dts/internal/shardManagerState.d.ts.map +1 -0
- package/dist/dts/internal/sharding.d.ts +2 -0
- package/dist/dts/internal/sharding.d.ts.map +1 -0
- package/dist/dts/internal/shardingConfig.d.ts +2 -0
- package/dist/dts/internal/shardingConfig.d.ts.map +1 -0
- package/dist/dts/internal/storage.d.ts +2 -0
- package/dist/dts/internal/storage.d.ts.map +1 -0
- package/dist/dts/internal/utils.d.ts +2 -0
- package/dist/dts/internal/utils.d.ts.map +1 -0
- package/dist/esm/AtLeastOnce.js +12 -0
- package/dist/esm/AtLeastOnce.js.map +1 -0
- package/dist/esm/AtLeastOnceStorage.js +17 -0
- package/dist/esm/AtLeastOnceStorage.js.map +1 -0
- package/dist/esm/Broadcaster.js +2 -0
- package/dist/esm/Broadcaster.js.map +1 -0
- package/dist/esm/ManagerConfig.js +26 -0
- package/dist/esm/ManagerConfig.js.map +1 -0
- package/dist/esm/Message.js +33 -0
- package/dist/esm/Message.js.map +1 -0
- package/dist/esm/MessageState.js +47 -0
- package/dist/esm/MessageState.js.map +1 -0
- package/dist/esm/Messenger.js +2 -0
- package/dist/esm/Messenger.js.map +1 -0
- package/dist/esm/Pod.js +65 -0
- package/dist/esm/Pod.js.map +1 -0
- package/dist/esm/PodAddress.js +64 -0
- package/dist/esm/PodAddress.js.map +1 -0
- package/dist/esm/Pods.js +27 -0
- package/dist/esm/Pods.js.map +1 -0
- package/dist/esm/PodsHealth.js +33 -0
- package/dist/esm/PodsHealth.js.map +1 -0
- package/dist/esm/PoisonPill.js +65 -0
- package/dist/esm/PoisonPill.js.map +1 -0
- package/dist/esm/RecipientAddress.js +67 -0
- package/dist/esm/RecipientAddress.js.map +1 -0
- package/dist/esm/RecipientBehaviour.js +30 -0
- package/dist/esm/RecipientBehaviour.js.map +1 -0
- package/dist/esm/RecipientBehaviourContext.js +56 -0
- package/dist/esm/RecipientBehaviourContext.js.map +1 -0
- package/dist/esm/RecipientType.js +105 -0
- package/dist/esm/RecipientType.js.map +1 -0
- package/dist/esm/Serialization.js +24 -0
- package/dist/esm/Serialization.js.map +1 -0
- package/dist/esm/SerializedEnvelope.js +75 -0
- package/dist/esm/SerializedEnvelope.js.map +1 -0
- package/dist/esm/SerializedMessage.js +51 -0
- package/dist/esm/SerializedMessage.js.map +1 -0
- package/dist/esm/ShardId.js +54 -0
- package/dist/esm/ShardId.js.map +1 -0
- package/dist/esm/ShardManager.js +17 -0
- package/dist/esm/ShardManager.js.map +1 -0
- package/dist/esm/ShardManagerClient.js +22 -0
- package/dist/esm/ShardManagerClient.js.map +1 -0
- package/dist/esm/Sharding.js +98 -0
- package/dist/esm/Sharding.js.map +1 -0
- package/dist/esm/ShardingConfig.js +33 -0
- package/dist/esm/ShardingConfig.js.map +1 -0
- package/dist/esm/ShardingEvent.js +62 -0
- package/dist/esm/ShardingEvent.js.map +1 -0
- package/dist/esm/ShardingException.js +91 -0
- package/dist/esm/ShardingException.js.map +1 -0
- package/dist/esm/ShardingRegistrationEvent.js +36 -0
- package/dist/esm/ShardingRegistrationEvent.js.map +1 -0
- package/dist/esm/Storage.js +32 -0
- package/dist/esm/Storage.js.map +1 -0
- package/dist/esm/index.js +113 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/atLeastOnce.js +26 -0
- package/dist/esm/internal/atLeastOnce.js.map +1 -0
- package/dist/esm/internal/atLeastOnceStorage.js +154 -0
- package/dist/esm/internal/atLeastOnceStorage.js.map +1 -0
- package/dist/esm/internal/entityManager.js +159 -0
- package/dist/esm/internal/entityManager.js.map +1 -0
- package/dist/esm/internal/entityState.js +35 -0
- package/dist/esm/internal/entityState.js.map +1 -0
- package/dist/esm/internal/managerConfig.js +38 -0
- package/dist/esm/internal/managerConfig.js.map +1 -0
- package/dist/esm/internal/message.js +32 -0
- package/dist/esm/internal/message.js.map +1 -0
- package/dist/esm/internal/messageState.js +66 -0
- package/dist/esm/internal/messageState.js.map +1 -0
- package/dist/esm/internal/podWithMetadata.js +41 -0
- package/dist/esm/internal/podWithMetadata.js.map +1 -0
- package/dist/esm/internal/pods.js +25 -0
- package/dist/esm/internal/pods.js.map +1 -0
- package/dist/esm/internal/podsHealth.js +30 -0
- package/dist/esm/internal/podsHealth.js.map +1 -0
- package/dist/esm/internal/recipientBehaviour.js +42 -0
- package/dist/esm/internal/recipientBehaviour.js.map +1 -0
- package/dist/esm/internal/recipientBehaviourContext.js +26 -0
- package/dist/esm/internal/recipientBehaviourContext.js.map +1 -0
- package/dist/esm/internal/serialization.js +39 -0
- package/dist/esm/internal/serialization.js.map +1 -0
- package/dist/esm/internal/shardManager.js +256 -0
- package/dist/esm/internal/shardManager.js.map +1 -0
- package/dist/esm/internal/shardManagerClient.js +38 -0
- package/dist/esm/internal/shardManagerClient.js.map +1 -0
- package/dist/esm/internal/shardManagerState.js +36 -0
- package/dist/esm/internal/shardManagerState.js.map +1 -0
- package/dist/esm/internal/sharding.js +288 -0
- package/dist/esm/internal/sharding.js.map +1 -0
- package/dist/esm/internal/shardingConfig.js +47 -0
- package/dist/esm/internal/shardingConfig.js.map +1 -0
- package/dist/esm/internal/storage.js +42 -0
- package/dist/esm/internal/storage.js.map +1 -0
- package/dist/esm/internal/utils.js +56 -0
- package/dist/esm/internal/utils.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/package.json +259 -0
- package/src/AtLeastOnce.ts +28 -0
- package/src/AtLeastOnceStorage.ts +96 -0
- package/src/Broadcaster.ts +48 -0
- package/src/ManagerConfig.ts +67 -0
- package/src/Message.ts +132 -0
- package/src/MessageState.ts +126 -0
- package/src/Messenger.ts +40 -0
- package/src/Pod.ts +95 -0
- package/src/PodAddress.ts +94 -0
- package/src/Pods.ts +100 -0
- package/src/PodsHealth.ts +74 -0
- package/src/PoisonPill.ts +105 -0
- package/src/RecipientAddress.ts +72 -0
- package/src/RecipientBehaviour.ts +108 -0
- package/src/RecipientBehaviourContext.ts +101 -0
- package/src/RecipientType.ts +134 -0
- package/src/Serialization.ts +72 -0
- package/src/SerializedEnvelope.ts +109 -0
- package/src/SerializedMessage.ts +82 -0
- package/src/ShardId.ts +79 -0
- package/src/ShardManager.ts +53 -0
- package/src/ShardManagerClient.ts +57 -0
- package/src/Sharding.ts +214 -0
- package/src/ShardingConfig.ts +76 -0
- package/src/ShardingEvent.ts +121 -0
- package/src/ShardingException.ts +151 -0
- package/src/ShardingRegistrationEvent.ts +62 -0
- package/src/Storage.ts +92 -0
- package/src/index.ts +139 -0
- package/src/internal/atLeastOnce.ts +59 -0
- package/src/internal/atLeastOnceStorage.ts +218 -0
- package/src/internal/entityManager.ts +404 -0
- package/src/internal/entityState.ts +64 -0
- package/src/internal/managerConfig.ts +84 -0
- package/src/internal/message.ts +64 -0
- package/src/internal/messageState.ts +98 -0
- package/src/internal/podWithMetadata.ts +72 -0
- package/src/internal/pods.ts +29 -0
- package/src/internal/podsHealth.ts +39 -0
- package/src/internal/recipientBehaviour.ts +133 -0
- package/src/internal/recipientBehaviourContext.ts +70 -0
- package/src/internal/serialization.ts +59 -0
- package/src/internal/shardManager.ts +593 -0
- package/src/internal/shardManagerClient.ts +49 -0
- package/src/internal/shardManagerState.ts +80 -0
- package/src/internal/sharding.ts +793 -0
- package/src/internal/shardingConfig.ts +97 -0
- package/src/internal/storage.ts +60 -0
- package/src/internal/utils.ts +54 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import type * as Effect from "effect/Effect";
|
5
|
+
import type * as Message from "./Message.js";
|
6
|
+
import type * as ShardingException from "./ShardingException.js";
|
7
|
+
/**
|
8
|
+
* An interface to communicate with a remote entity.
|
9
|
+
*
|
10
|
+
* @tparam Msg the type of message that can be sent to this entity type
|
11
|
+
* @since 1.0.0
|
12
|
+
* @category models
|
13
|
+
*/
|
14
|
+
export interface Messenger<Msg extends Message.Message.Any> {
|
15
|
+
/**
|
16
|
+
* Send a message without waiting for a response (fire and forget)
|
17
|
+
*
|
18
|
+
* You can use Effect timeout to get send timeouts. The default behaviour is to send the message indifinetely
|
19
|
+
*
|
20
|
+
* @since 1.0.0
|
21
|
+
*/
|
22
|
+
sendDiscard(entityId: string): (message: Msg) => Effect.Effect<void, ShardingException.ShardingException>;
|
23
|
+
/**
|
24
|
+
* Send a message and wait for a response.
|
25
|
+
*
|
26
|
+
* You can use Effect timeout to get send timeouts. The default behaviour is to send the message indifinetely
|
27
|
+
*
|
28
|
+
* @since 1.0.0
|
29
|
+
*/
|
30
|
+
send(entityId: string): <A extends Msg>(message: A) => Effect.Effect<Message.Message.Success<A>, ShardingException.ShardingException | Message.Message.Error<A>>;
|
31
|
+
}
|
32
|
+
//# sourceMappingURL=Messenger.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Messenger.d.ts","sourceRoot":"","sources":["../../src/Messenger.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,SAAS,CAAC,GAAG,SAAS,OAAO,CAAC,OAAO,CAAC,GAAG;IACxD;;;;;;OAMG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAA;IAEzG;;;;;;OAMG;IACH,IAAI,CACF,QAAQ,EAAE,MAAM,GACf,CAAC,CAAC,SAAS,GAAG,EACf,OAAO,EAAE,CAAC,KACP,MAAM,CAAC,MAAM,CAChB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAC1B,iBAAiB,CAAC,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAC/D,CAAA;CACF"}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import * as Schema from "@effect/schema/Schema";
|
5
|
+
import * as PodAddress from "./PodAddress.js";
|
6
|
+
/**
|
7
|
+
* @since 1.0.0
|
8
|
+
* @category symbols
|
9
|
+
*/
|
10
|
+
export declare const PodTypeId: unique symbol;
|
11
|
+
/**
|
12
|
+
* @since 1.0.0
|
13
|
+
* @category symbols
|
14
|
+
*/
|
15
|
+
export type PodTypeId = typeof PodTypeId;
|
16
|
+
declare const Pod_base: Schema.Class<Pod, {
|
17
|
+
[PodTypeId]: Schema.PropertySignature<":", typeof PodTypeId, "@effect/cluster/Pod", ":", "@effect/cluster/Pod", false, never>;
|
18
|
+
address: Schema.Schema<PodAddress.PodAddress, PodAddress.PodAddress.Encoded, never>;
|
19
|
+
version: typeof Schema.String;
|
20
|
+
}, Schema.Struct.Encoded<{
|
21
|
+
[PodTypeId]: Schema.PropertySignature<":", typeof PodTypeId, "@effect/cluster/Pod", ":", "@effect/cluster/Pod", false, never>;
|
22
|
+
address: Schema.Schema<PodAddress.PodAddress, PodAddress.PodAddress.Encoded, never>;
|
23
|
+
version: typeof Schema.String;
|
24
|
+
}>, never, {
|
25
|
+
readonly [PodTypeId]: typeof PodTypeId;
|
26
|
+
} & {
|
27
|
+
readonly address: PodAddress.PodAddress;
|
28
|
+
} & {
|
29
|
+
readonly version: string;
|
30
|
+
}, {}, {}>;
|
31
|
+
/**
|
32
|
+
* A pod is an application server that is able to run entities. A pod can run multiple entities,
|
33
|
+
* but a single entity will live on a given pod at a time.
|
34
|
+
* Since this is an application server, it needs to have an unique identifier where it's addressed (PodAddress),
|
35
|
+
* and has a version of the application that's running on it.
|
36
|
+
* Version is used during the rebalance phase to give priority to newer application servers and slowly kill older ones.
|
37
|
+
*
|
38
|
+
* @since 1.0.0
|
39
|
+
* @category models
|
40
|
+
*/
|
41
|
+
export declare class Pod extends Pod_base {
|
42
|
+
/**
|
43
|
+
* @since 1.0.0
|
44
|
+
*/
|
45
|
+
toString(): string;
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* @since 1.0.0
|
49
|
+
* @category models
|
50
|
+
*/
|
51
|
+
export declare namespace Pod {
|
52
|
+
/**
|
53
|
+
* This is the shape that a Pod is represented over the wire.
|
54
|
+
*
|
55
|
+
* @since 1.0.0
|
56
|
+
* @category models
|
57
|
+
*/
|
58
|
+
interface Encoded extends Schema.Schema.Encoded<typeof Pod> {
|
59
|
+
}
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Given a value, ensures that it's a valid Pod.
|
63
|
+
*
|
64
|
+
* @since 1.0.0
|
65
|
+
* @category utils
|
66
|
+
*/
|
67
|
+
export declare function isPod(value: unknown): value is Pod;
|
68
|
+
/**
|
69
|
+
* Constructs a Pod from it's identifing PodAddress and application server version.
|
70
|
+
*
|
71
|
+
* @since 1.0.0
|
72
|
+
* @category constructors
|
73
|
+
*/
|
74
|
+
export declare function make(address: PodAddress.PodAddress, version: string): Pod;
|
75
|
+
/**
|
76
|
+
* @since 1.0.0
|
77
|
+
* @category schema
|
78
|
+
*/
|
79
|
+
export declare const schema: Schema.Schema<Pod, Pod.Encoded>;
|
80
|
+
export {};
|
81
|
+
//# sourceMappingURL=Pod.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Pod.d.ts","sourceRoot":"","sources":["../../src/Pod.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAE/C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAK7C;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,MAAiC,CAAA;AAEhE;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAA;;;;;;;;;;;;;;;;AAKxC;;;;;;;;;GASG;AACH,qBAAa,GAAI,SAAQ,QAIvB;IACA;;OAEG;IACH,QAAQ;CAGT;AAED;;;GAGG;AACH,yBAAiB,GAAG,CAAC;IACnB;;;;;OAKG;IACH,UAAiB,OAAQ,SAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC;KAAG;CACtE;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,GAAG,CAOlD;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAEzE;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CAChC,GAAG,EACH,GAAG,CAAC,OAAO,CACW,CAAA"}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import * as Schema from "@effect/schema/Schema";
|
5
|
+
/**
|
6
|
+
* @since 1.0.0
|
7
|
+
* @category symbols
|
8
|
+
*/
|
9
|
+
export declare const PodAddressTypeId: unique symbol;
|
10
|
+
/**
|
11
|
+
* @since 1.0.0
|
12
|
+
* @category symbols
|
13
|
+
*/
|
14
|
+
export type PodAddressTypeId = typeof PodAddressTypeId;
|
15
|
+
declare const PodAddress_base: Schema.Class<PodAddress, {
|
16
|
+
[PodAddressTypeId]: Schema.PropertySignature<":", typeof PodAddressTypeId, "@effect/cluster/PodAddress", ":", "@effect/cluster/PodAddress", false, never>;
|
17
|
+
host: typeof Schema.String;
|
18
|
+
port: typeof Schema.Number;
|
19
|
+
}, Schema.Struct.Encoded<{
|
20
|
+
[PodAddressTypeId]: Schema.PropertySignature<":", typeof PodAddressTypeId, "@effect/cluster/PodAddress", ":", "@effect/cluster/PodAddress", false, never>;
|
21
|
+
host: typeof Schema.String;
|
22
|
+
port: typeof Schema.Number;
|
23
|
+
}>, never, {
|
24
|
+
readonly [PodAddressTypeId]: typeof PodAddressTypeId;
|
25
|
+
} & {
|
26
|
+
readonly host: string;
|
27
|
+
} & {
|
28
|
+
readonly port: number;
|
29
|
+
}, {}, {}>;
|
30
|
+
/**
|
31
|
+
* A PodAddress is a unique identifier of a Pod (application server).
|
32
|
+
* It is conventially built by using an address and a port, so that messaging implementations may use directly the
|
33
|
+
* PodAddress to know how to connect to the specific Pod.
|
34
|
+
*
|
35
|
+
* @since 1.0.0
|
36
|
+
* @category models
|
37
|
+
*/
|
38
|
+
export declare class PodAddress extends PodAddress_base {
|
39
|
+
/**
|
40
|
+
* @since 1.0.0
|
41
|
+
*/
|
42
|
+
toString(): string;
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* @since 1.0.0
|
46
|
+
* @category models
|
47
|
+
*/
|
48
|
+
export declare namespace PodAddress {
|
49
|
+
/**
|
50
|
+
* This is the shape one PodAddress has over the wire.
|
51
|
+
*
|
52
|
+
* @since 1.0.0
|
53
|
+
* @category models
|
54
|
+
*/
|
55
|
+
interface Encoded extends Schema.Schema.Encoded<typeof PodAddress> {
|
56
|
+
}
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* Constructs a PodAddress from an host and a port.
|
60
|
+
*
|
61
|
+
* @since 1.0.0
|
62
|
+
* @category constructors
|
63
|
+
*/
|
64
|
+
export declare function make(host: string, port: number): PodAddress;
|
65
|
+
/**
|
66
|
+
* Ensures that the given value is a valid PodAddress.
|
67
|
+
*
|
68
|
+
* @since 1.0.0
|
69
|
+
* @category utils
|
70
|
+
*/
|
71
|
+
export declare function isPodAddress(value: unknown): value is PodAddress;
|
72
|
+
/**
|
73
|
+
* This is the schema for a PodAddress.
|
74
|
+
*
|
75
|
+
* @since 1.0.0
|
76
|
+
* @category schema
|
77
|
+
*/
|
78
|
+
export declare const schema: Schema.Schema<PodAddress, PodAddress.Encoded>;
|
79
|
+
export {};
|
80
|
+
//# sourceMappingURL=PodAddress.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PodAddress.d.ts","sourceRoot":"","sources":["../../src/PodAddress.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAM/C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,MAAwC,CAAA;AAK9E;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAA;;;;;;;;;;;;;;;;AAEtD;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,eAI9B;IACA;;OAEG;IACH,QAAQ;CAGT;AAED;;;GAGG;AACH,yBAAiB,UAAU,CAAC;IAC1B;;;;;OAKG;IACH,UAAiB,OAAQ,SAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,UAAU,CAAC;KAAG;CAC7E;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAOhE;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CAChC,UAAU,EACV,UAAU,CAAC,OAAO,CACW,CAAA"}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import type * as Context from "effect/Context";
|
5
|
+
import type * as Effect from "effect/Effect";
|
6
|
+
import type * as HashSet from "effect/HashSet";
|
7
|
+
import type * as Layer from "effect/Layer";
|
8
|
+
import type * as MessageState from "./MessageState.js";
|
9
|
+
import type * as PodAddress from "./PodAddress.js";
|
10
|
+
import type * as SerializedEnvelope from "./SerializedEnvelope.js";
|
11
|
+
import type * as SerializedMessage from "./SerializedMessage.js";
|
12
|
+
import type * as ShardId from "./ShardId.js";
|
13
|
+
import type * as ShardingException from "./ShardingException.js";
|
14
|
+
/**
|
15
|
+
* @since 1.0.0
|
16
|
+
* @category symbols
|
17
|
+
*/
|
18
|
+
export declare const PodsTypeId: unique symbol;
|
19
|
+
/**
|
20
|
+
* @since 1.0.0
|
21
|
+
* @category symbols
|
22
|
+
*/
|
23
|
+
export type PodsTypeId = typeof PodsTypeId;
|
24
|
+
/**
|
25
|
+
* An interface to communicate with remote pods.
|
26
|
+
* This is used by the Shard Manager for assigning and unassigning shards.
|
27
|
+
* This is also used by pods for internal communication (forward messages to each other).
|
28
|
+
*
|
29
|
+
* @since 1.0.0
|
30
|
+
* @category models
|
31
|
+
*/
|
32
|
+
export interface Pods {
|
33
|
+
/**
|
34
|
+
* @since 1.0.0
|
35
|
+
*/
|
36
|
+
readonly [PodsTypeId]: PodsTypeId;
|
37
|
+
/**
|
38
|
+
* Notify a pod that it was assigned a list of shards
|
39
|
+
* @since 1.0.0
|
40
|
+
*/
|
41
|
+
readonly assignShards: (pod: PodAddress.PodAddress, shards: HashSet.HashSet<ShardId.ShardId>) => Effect.Effect<void, ShardingException.PodUnavailableException>;
|
42
|
+
/**
|
43
|
+
* Notify a pod that it was unassigned a list of shards
|
44
|
+
* @since 1.0.0
|
45
|
+
*/
|
46
|
+
readonly unassignShards: (pod: PodAddress.PodAddress, shards: HashSet.HashSet<ShardId.ShardId>) => Effect.Effect<void, ShardingException.PodUnavailableException>;
|
47
|
+
/**
|
48
|
+
* Check that a pod is responsive
|
49
|
+
* @since 1.0.0
|
50
|
+
*/
|
51
|
+
readonly ping: (pod: PodAddress.PodAddress) => Effect.Effect<void, ShardingException.PodUnavailableException>;
|
52
|
+
/**
|
53
|
+
* Send a message to a pod and receive its message state
|
54
|
+
* @since 1.0.0
|
55
|
+
*/
|
56
|
+
readonly sendAndGetState: (pod: PodAddress.PodAddress, envelope: SerializedEnvelope.SerializedEnvelope) => Effect.Effect<MessageState.MessageState<SerializedMessage.SerializedMessage>, ShardingException.ShardingException>;
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* @since 1.0.0
|
60
|
+
* @category context
|
61
|
+
*/
|
62
|
+
export declare const Pods: Context.Tag<Pods, Pods>;
|
63
|
+
/**
|
64
|
+
* Constructs a Pods service from its implementation
|
65
|
+
*
|
66
|
+
* @since 1.0.0
|
67
|
+
* @category context
|
68
|
+
*/
|
69
|
+
export declare const make: (args: Omit<Pods, typeof PodsTypeId>) => Pods;
|
70
|
+
/**
|
71
|
+
* A layer that creates a service that does nothing when called.
|
72
|
+
* Useful for testing ShardManager or when using Sharding.local.
|
73
|
+
*
|
74
|
+
* @since 1.0.0
|
75
|
+
* @category layers
|
76
|
+
*/
|
77
|
+
export declare const noop: Layer.Layer<Pods>;
|
78
|
+
//# sourceMappingURL=Pods.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Pods.d.ts","sourceRoot":"","sources":["../../src/Pods.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAEhE;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,OAAO,MAA4B,CAAA;AAE5D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAA;AAE1C;;;;;;;GAOG;AACH,MAAM,WAAW,IAAI;IACnB;;OAEG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,CAAA;IAEjC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,CACrB,GAAG,EAAE,UAAU,CAAC,UAAU,EAC1B,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KACrC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,CAAA;IAEnE;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,CACvB,GAAG,EAAE,UAAU,CAAC,UAAU,EAC1B,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KACrC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,CAAA;IAEnE;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,uBAAuB,CAAC,CAAA;IAE7G;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,CACxB,GAAG,EAAE,UAAU,CAAC,UAAU,EAC1B,QAAQ,EAAE,kBAAkB,CAAC,kBAAkB,KAC5C,MAAM,CAAC,MAAM,CAChB,YAAY,CAAC,YAAY,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,EAC9D,iBAAiB,CAAC,iBAAiB,CACpC,CAAA;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAoB,CAAA;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,UAAU,CAAC,KAAK,IAAoB,CAAA;AAEhF;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAiB,CAAA"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import type * as Context from "effect/Context";
|
5
|
+
import type * as Effect from "effect/Effect";
|
6
|
+
import type * as Layer from "effect/Layer";
|
7
|
+
import type * as PodAddress from "./PodAddress.js";
|
8
|
+
import type * as Pods from "./Pods.js";
|
9
|
+
/**
|
10
|
+
* @since 1.0.0
|
11
|
+
* @category symbols
|
12
|
+
*/
|
13
|
+
export declare const PodsHealthTypeId: unique symbol;
|
14
|
+
/**
|
15
|
+
* @since 1.0.0
|
16
|
+
* @category symbols
|
17
|
+
*/
|
18
|
+
export type PodsHealthTypeId = typeof PodsHealthTypeId;
|
19
|
+
/**
|
20
|
+
* An interface to check a pod's health.
|
21
|
+
* This is used when a pod is unresponsive, to check if it should be unassigned all its shards or not.
|
22
|
+
* If the pod is alive, shards will not be unassigned because the pods might still be processing messages and might be responsive again.
|
23
|
+
* If the pod is not alive, shards can be safely reassigned somewhere else.
|
24
|
+
* A typical implementation for this is using k8s to check if the pod still exists.
|
25
|
+
*
|
26
|
+
* @since 1.0.0
|
27
|
+
* @category models
|
28
|
+
*/
|
29
|
+
export interface PodsHealth {
|
30
|
+
/**
|
31
|
+
* @since 1.0.0
|
32
|
+
*/
|
33
|
+
readonly [PodsHealthTypeId]: PodsHealthTypeId;
|
34
|
+
/**
|
35
|
+
* Check if a pod is still alive.
|
36
|
+
* @since 1.0.0
|
37
|
+
*/
|
38
|
+
readonly isAlive: (podAddress: PodAddress.PodAddress) => Effect.Effect<boolean>;
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* Constructs a PodsHealth from its implementation
|
42
|
+
*
|
43
|
+
* @since 1.0.0
|
44
|
+
* @category constructors
|
45
|
+
*/
|
46
|
+
export declare const make: (args: Omit<PodsHealth, typeof PodsHealthTypeId>) => PodsHealth;
|
47
|
+
/**
|
48
|
+
* @since 1.0.0
|
49
|
+
* @category context
|
50
|
+
*/
|
51
|
+
export declare const PodsHealth: Context.Tag<PodsHealth, PodsHealth>;
|
52
|
+
/**
|
53
|
+
* A layer that considers pods as always alive.
|
54
|
+
* This is useful for testing only.
|
55
|
+
* @since 1.0.0
|
56
|
+
* @category layers
|
57
|
+
*/
|
58
|
+
export declare const noop: Layer.Layer<PodsHealth>;
|
59
|
+
/**
|
60
|
+
* A layer that pings the pod directly to check if it's alive.
|
61
|
+
* This is useful for developing and testing but not reliable in production.
|
62
|
+
* @since 1.0.0
|
63
|
+
* @category layers
|
64
|
+
*/
|
65
|
+
export declare const local: Layer.Layer<PodsHealth, never, Pods.Pods>;
|
66
|
+
//# sourceMappingURL=PodsHealth.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PodsHealth.d.ts","sourceRoot":"","sources":["../../src/PodsHealth.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAA;AAEtC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,MAAkC,CAAA;AAExE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAA;AAEtD;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,CAAC,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IAE7C;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;CAChF;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,gBAAgB,CAAC,KAAK,UAA0B,CAAA;AAElG;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAA0B,CAAA;AAErF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAiB,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAkB,CAAA"}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import * as Schema from "@effect/schema/Schema";
|
5
|
+
import * as Effect from "effect/Effect";
|
6
|
+
import * as Queue from "effect/Queue";
|
7
|
+
/**
|
8
|
+
* @since 1.0.0
|
9
|
+
* @category symbols
|
10
|
+
*/
|
11
|
+
export declare const PoisonPillTypeId: unique symbol;
|
12
|
+
/**
|
13
|
+
* @since 1.0.0
|
14
|
+
* @category symbols
|
15
|
+
*/
|
16
|
+
export type PoisonPillTypeId = typeof PoisonPillTypeId;
|
17
|
+
/**
|
18
|
+
* @since 1.0.0
|
19
|
+
*/
|
20
|
+
export declare namespace PoisonPill {
|
21
|
+
/**
|
22
|
+
* This is the shape that a PoisonPill takes over the wire.
|
23
|
+
*
|
24
|
+
* @since 1.0.0
|
25
|
+
* @category models
|
26
|
+
*/
|
27
|
+
interface Encoded extends Schema.Schema.Encoded<typeof PoisonPill> {
|
28
|
+
}
|
29
|
+
}
|
30
|
+
declare const PoisonPill_base: Schema.Class<PoisonPill, {
|
31
|
+
[PoisonPillTypeId]: Schema.PropertySignature<":", typeof PoisonPillTypeId, "@effect/cluster/PoisonPill", ":", "@effect/cluster/PoisonPill", false, never>;
|
32
|
+
}, Schema.Struct.Encoded<{
|
33
|
+
[PoisonPillTypeId]: Schema.PropertySignature<":", typeof PoisonPillTypeId, "@effect/cluster/PoisonPill", ":", "@effect/cluster/PoisonPill", false, never>;
|
34
|
+
}>, never, {
|
35
|
+
readonly [PoisonPillTypeId]: typeof PoisonPillTypeId;
|
36
|
+
}, {}, {}>;
|
37
|
+
/**
|
38
|
+
* A PoisonPill is a special value that tells a behaviour entity to shut itself down.
|
39
|
+
* PoisonPill is handled only when you are using a Queue-based RecipientBehaviour.
|
40
|
+
* Other RecipientBehaviour such as fromFunctionEffect would not care about PoisonPill.
|
41
|
+
*
|
42
|
+
* @since 1.0.0
|
43
|
+
* @category models
|
44
|
+
*/
|
45
|
+
export declare class PoisonPill extends PoisonPill_base {
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* Constructs a new PosionPill
|
49
|
+
*
|
50
|
+
* @since 1.0.0
|
51
|
+
* @category constructors
|
52
|
+
*/
|
53
|
+
export declare const make: Effect.Effect<PoisonPill>;
|
54
|
+
/**
|
55
|
+
* Checks if the given value is a PoisonPill.
|
56
|
+
*
|
57
|
+
* @since 1.0.0
|
58
|
+
* @category utils
|
59
|
+
*/
|
60
|
+
export declare function isPoisonPill(value: unknown): value is PoisonPill;
|
61
|
+
/**
|
62
|
+
* This is the schema for a PoisonPill that is used to encode the value over the wire.
|
63
|
+
* This is useful if you want a behavior that can be shut down from an external message.
|
64
|
+
*
|
65
|
+
* @since 1.0.0
|
66
|
+
* @category schema
|
67
|
+
*/
|
68
|
+
export declare const schema: Schema.Schema<PoisonPill, PoisonPill.Encoded>;
|
69
|
+
/**
|
70
|
+
* Attempts to take a message from the queue in the same way Queue.take does.
|
71
|
+
* If the result is a PoisonPill, it will interrupt the effect.
|
72
|
+
*
|
73
|
+
* @since 1.0.0
|
74
|
+
* @category utils
|
75
|
+
*/
|
76
|
+
export declare function takeOrInterrupt<Req>(dequeue: Queue.Dequeue<Req | PoisonPill>): Effect.Effect<Req>;
|
77
|
+
export {};
|
78
|
+
//# sourceMappingURL=PoisonPill.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PoisonPill.d.ts","sourceRoot":"","sources":["../../src/PoisonPill.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAC/C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAMrC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,MAAwC,CAAA;AAE9E;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAA;AAKtD;;GAEG;AACH,yBAAiB,UAAU,CAAC;IAC1B;;;;;OAKG;IACH,UAAiB,OAAQ,SAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,UAAU,CAAC;KAAG;CAC7E;;;;;;;;AAED;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,eAE9B;CACD;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAE1C,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAOhE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CAChC,UAAU,EACV,UAAU,CAAC,OAAO,CACW,CAAA;AAE/B;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EACjC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,UAAU,CAAC,GACvC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAKpB"}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import * as Schema from "@effect/schema/Schema";
|
5
|
+
import * as Equal from "effect/Equal";
|
6
|
+
import * as Hash from "effect/Hash";
|
7
|
+
/**
|
8
|
+
* @since 1.0.0
|
9
|
+
* @category symbols
|
10
|
+
*/
|
11
|
+
export declare const RecipientAddressTypeId: unique symbol;
|
12
|
+
declare const RecipientAddress_base: Schema.Class<RecipientAddress, {
|
13
|
+
[RecipientAddressTypeId]: Schema.PropertySignature<":", typeof RecipientAddressTypeId, "@effect/cluster/RecipientAddress", ":", "@effect/cluster/RecipientAddress", false, never>;
|
14
|
+
recipientTypeName: typeof Schema.String;
|
15
|
+
entityId: typeof Schema.String;
|
16
|
+
}, Schema.Struct.Encoded<{
|
17
|
+
[RecipientAddressTypeId]: Schema.PropertySignature<":", typeof RecipientAddressTypeId, "@effect/cluster/RecipientAddress", ":", "@effect/cluster/RecipientAddress", false, never>;
|
18
|
+
recipientTypeName: typeof Schema.String;
|
19
|
+
entityId: typeof Schema.String;
|
20
|
+
}>, never, {
|
21
|
+
readonly [RecipientAddressTypeId]: typeof RecipientAddressTypeId;
|
22
|
+
} & {
|
23
|
+
readonly recipientTypeName: string;
|
24
|
+
} & {
|
25
|
+
readonly entityId: string;
|
26
|
+
}, {}, {}>;
|
27
|
+
/**
|
28
|
+
* A RecipientAddress uniquely identifies a RecipientType + EntityId instance.
|
29
|
+
*
|
30
|
+
* @since 1.0.0
|
31
|
+
* @category models
|
32
|
+
*/
|
33
|
+
export declare class RecipientAddress extends RecipientAddress_base {
|
34
|
+
/**
|
35
|
+
* @since 1.0.0
|
36
|
+
*/
|
37
|
+
[Hash.symbol](): number;
|
38
|
+
/**
|
39
|
+
* @since 1.0.0
|
40
|
+
*/
|
41
|
+
[Equal.symbol](this: RecipientAddress, that: Equal.Equal): boolean;
|
42
|
+
}
|
43
|
+
/**
|
44
|
+
* Ensure that given value is a RecipientAddress
|
45
|
+
* @since 1.0.0
|
46
|
+
* @category constructors
|
47
|
+
*/
|
48
|
+
export declare function isRecipientAddress(value: unknown): value is RecipientAddress;
|
49
|
+
/**
|
50
|
+
* Given a name and a schema for the protocol, constructs an EntityType.
|
51
|
+
*
|
52
|
+
* @since 1.0.0
|
53
|
+
* @category constructors
|
54
|
+
*/
|
55
|
+
export declare function makeRecipientAddress(recipientTypeName: string, entityId: string): RecipientAddress;
|
56
|
+
export {};
|
57
|
+
//# sourceMappingURL=RecipientAddress.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RecipientAddress.d.ts","sourceRoot":"","sources":["../../src/RecipientAddress.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAC/C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AAKnC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAAO,MAA8C,CAAA;;;;;;;;;;;;;;;;AAK1F;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,qBAMpC;IACA;;OAEG;IACH,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM;IAIvB;;OAEG;IACH,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,GAAG,OAAO;CAMnE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAG5E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,GACf,gBAAgB,CAElB"}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import type * as Message from "@effect/cluster/Message";
|
5
|
+
import type * as Duration from "effect/Duration";
|
6
|
+
import type * as Effect from "effect/Effect";
|
7
|
+
import type * as Option from "effect/Option";
|
8
|
+
import type * as Queue from "effect/Queue";
|
9
|
+
import type * as Ref from "effect/Ref";
|
10
|
+
import type * as Scope from "effect/Scope";
|
11
|
+
import type * as MessageState from "./MessageState.js";
|
12
|
+
import type * as PoisonPill from "./PoisonPill.js";
|
13
|
+
import type * as RecipientBehaviourContext from "./RecipientBehaviourContext.js";
|
14
|
+
import type * as ShardingException from "./ShardingException.js";
|
15
|
+
/**
|
16
|
+
* A RecipientBehaviour describes how a specific RecipientType should behave.
|
17
|
+
* This is the actual implementation of what an entity should do upon receiving a Msg,
|
18
|
+
* this could require additional context.
|
19
|
+
*
|
20
|
+
* The scope provided in the context is controlled by the cluster EntityManager,
|
21
|
+
* and is used to request the shoutdown of the entity,
|
22
|
+
* so you can safely scope whatever resource you want to use for your behaviour
|
23
|
+
* and the EntityManager will close the scope for you when the entity is shoutdown.
|
24
|
+
*
|
25
|
+
* The function returned by the RecipientBehaviour effect is what we call "offer" effect.
|
26
|
+
* The offer effect is used by the EntityManager to give messages to the RecipientBehaviour.
|
27
|
+
*
|
28
|
+
* @since 1.0.0
|
29
|
+
* @category models
|
30
|
+
*/
|
31
|
+
export interface RecipientBehaviour<Msg, R> extends Effect.Effect<(<A extends Msg>(message: A) => Effect.Effect<MessageState.MessageState<Message.Message.Exit<A>>, ShardingException.ExceptionWhileOfferingMessageException>), never, R | RecipientBehaviourContext.RecipientBehaviourContext | Scope.Scope> {
|
32
|
+
}
|
33
|
+
/**
|
34
|
+
* This are the options for an EntityBehaviour. This controls the entityMaxIdleTime,
|
35
|
+
* check out more on that over the ShardingConfig.
|
36
|
+
* This allows to override the setting for a specific entity.
|
37
|
+
*
|
38
|
+
* @since 1.0.0
|
39
|
+
* @category utils
|
40
|
+
*/
|
41
|
+
export type EntityBehaviourOptions = {
|
42
|
+
entityMaxIdleTime?: Option.Option<Duration.Duration>;
|
43
|
+
};
|
44
|
+
/**
|
45
|
+
* This is the simplest behaviour you can have.
|
46
|
+
* You provide a function that given the entityId and the message, it will immediatly process it.
|
47
|
+
* You are then required to return a MessageState to tell the caller
|
48
|
+
* if the message has just arrived and will be later processed or it has been processed.
|
49
|
+
*
|
50
|
+
* @since 1.0.0
|
51
|
+
* @category utils
|
52
|
+
*/
|
53
|
+
export declare const fromFunctionEffect: <Msg extends Message.Message.Any, R>(handler: (entityId: string, message: Msg) => Effect.Effect<MessageState.MessageState<Message.Message.Exit<Msg>>, never, R>) => RecipientBehaviour<Msg, R>;
|
54
|
+
/**
|
55
|
+
* This is a stateful version of fromFunctionEffect.
|
56
|
+
* You can provide a function to get the initialState, and then it will be passed as Ref.
|
57
|
+
* Everything here is just stored in memory, so eventual persistence of the state is up to you!
|
58
|
+
*
|
59
|
+
* @since 1.0.0
|
60
|
+
* @category utils
|
61
|
+
*/
|
62
|
+
export declare const fromFunctionEffectStateful: <S, R, Msg extends Message.Message.Any, R2>(initialState: (entityId: string) => Effect.Effect<S, never, R>, handler: (entityId: string, message: Msg, stateRef: Ref.Ref<S>) => Effect.Effect<MessageState.MessageState<Message.Message.Exit<Msg>>, never, R2>) => RecipientBehaviour<Msg, R | R2>;
|
63
|
+
/**
|
64
|
+
* This behaviour uses a Queue where the entity will accumulate messages to be processed,
|
65
|
+
* and then you can use the Dequeue to take messages and process them.
|
66
|
+
* A PoisonPill is provided to request interruption of the entity behaviour.
|
67
|
+
*
|
68
|
+
* @since 1.0.0
|
69
|
+
* @category utils
|
70
|
+
*/
|
71
|
+
export declare const fromInMemoryQueue: <Msg extends Message.Message.Any, R>(handler: (entityId: string, dequeue: Queue.Dequeue<Msg | PoisonPill.PoisonPill>, processed: <A extends Msg>(message: A, value: Option.Option<Message.Message.Exit<A>>) => Effect.Effect<void, never, never>) => Effect.Effect<void, never, R>) => RecipientBehaviour<Msg, R>;
|
72
|
+
//# sourceMappingURL=RecipientBehaviour.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RecipientBehaviour.d.ts","sourceRoot":"","sources":["../../src/RecipientBehaviour.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* @since 1.0.0
|
3
|
+
*/
|
4
|
+
import type * as Context from "effect/Context";
|
5
|
+
import type * as Effect from "effect/Effect";
|
6
|
+
import type * as Message from "./Message.js";
|
7
|
+
import type * as RecipientAddress from "./RecipientAddress.js";
|
8
|
+
import type * as RecipientType from "./RecipientType.js";
|
9
|
+
import type * as ShardId from "./ShardId.js";
|
10
|
+
/**
|
11
|
+
* @since 1.0.0
|
12
|
+
* @category symbols
|
13
|
+
*/
|
14
|
+
export declare const RecipientBehaviourContextTypeId: unique symbol;
|
15
|
+
/**
|
16
|
+
* @since 1.0.0
|
17
|
+
* @category symbols
|
18
|
+
*/
|
19
|
+
export type RecipientBehaviourContextTypeId = typeof RecipientBehaviourContextTypeId;
|
20
|
+
/**
|
21
|
+
* This is the context information that is available to the RecipientBehaviour and has general informations
|
22
|
+
* about this specific entity, like the entityId or the recipientType.
|
23
|
+
*
|
24
|
+
* @since 1.0.0
|
25
|
+
* @category models
|
26
|
+
*/
|
27
|
+
export interface RecipientBehaviourContext {
|
28
|
+
readonly [RecipientBehaviourContextTypeId]: RecipientBehaviourContextTypeId;
|
29
|
+
readonly recipientAddress: RecipientAddress.RecipientAddress;
|
30
|
+
readonly shardId: ShardId.ShardId;
|
31
|
+
readonly recipientType: RecipientType.RecipientType<Message.Message.Any>;
|
32
|
+
readonly forkShutdown: Effect.Effect<void>;
|
33
|
+
}
|
34
|
+
/**
|
35
|
+
* A tag to access current RecipientBehaviourContext
|
36
|
+
*
|
37
|
+
* @since 1.0.0
|
38
|
+
* @category context
|
39
|
+
*/
|
40
|
+
export declare const RecipientBehaviourContext: Context.Tag<RecipientBehaviourContext, RecipientBehaviourContext>;
|
41
|
+
/**
|
42
|
+
* Creates a new RecipientBehaviourContext
|
43
|
+
*
|
44
|
+
* @since 1.0.0
|
45
|
+
* @category constructors
|
46
|
+
*/
|
47
|
+
export declare const make: (args: Omit<RecipientBehaviourContext, typeof RecipientBehaviourContextTypeId>) => RecipientBehaviourContext;
|
48
|
+
/**
|
49
|
+
* Gets the current entityId
|
50
|
+
*
|
51
|
+
* @since 1.0.0
|
52
|
+
* @category utils
|
53
|
+
*/
|
54
|
+
export declare const entityId: Effect.Effect<string, never, RecipientBehaviourContext>;
|
55
|
+
/**
|
56
|
+
* Gets the current entityId
|
57
|
+
*
|
58
|
+
* @since 1.0.0
|
59
|
+
* @category utils
|
60
|
+
*/
|
61
|
+
export declare const recipientAddress: Effect.Effect<RecipientAddress.RecipientAddress, never, RecipientBehaviourContext>;
|
62
|
+
/**
|
63
|
+
* Gets the current shardId
|
64
|
+
*
|
65
|
+
* @since 1.0.0
|
66
|
+
* @category utils
|
67
|
+
*/
|
68
|
+
export declare const shardId: Effect.Effect<ShardId.ShardId, never, RecipientBehaviourContext>;
|
69
|
+
/**
|
70
|
+
* Gets the current recipientType
|
71
|
+
*
|
72
|
+
* @since 1.0.0
|
73
|
+
* @category utils
|
74
|
+
*/
|
75
|
+
export declare const recipientType: Effect.Effect<RecipientType.RecipientType<Message.Message.Any>, never, RecipientBehaviourContext>;
|
76
|
+
/**
|
77
|
+
* Forks the shutdown of the current recipient behaviour as soon as possible.
|
78
|
+
*
|
79
|
+
* @since 1.0.0
|
80
|
+
* @category utils
|
81
|
+
*/
|
82
|
+
export declare const forkShutdown: Effect.Effect<void, never, RecipientBehaviourContext>;
|
83
|
+
//# sourceMappingURL=RecipientBehaviourContext.d.ts.map
|