You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vuepress/docs/docs/config.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,14 @@ Ideally, we want to move each shard only once during the whole process.
24
24
This `serverVersion` allows the Shard Manager to know which pods are old and which are new. It will then pick the new pods to assign shards.
25
25
:::
26
26
-`entityMaxIdleTime`: time of inactivity (without receiving any message) after which an entity will be stopped
27
+
::: tip Termination Message
28
+
`registerEntity` takes an optional parameter called `terminationMessage`. This allows defining a message that will be sent to your entities before they are stopped (either by a rebalance or because of inactivity).
29
+
30
+
If no termination message is provided, the entity queues will simply be shutdown.
31
+
But if you want to ensure entities are stopped "cleanly" after processing their last message, define a termination message and stop the behavior yourself (by calling `ZIO.interrupt`) after receiving that message.
32
+
33
+
Termination messages must contain a promise which you need to complete to indicate that shutdown is complete. See the [example here](https://github.com/devsisters/shardcake/tree/series/2.x/examples/src/main/scala/example/complex).
34
+
:::
27
35
-`entityTerminationTimeout`: time we give to an entity to handle the termination message before interrupting it
28
36
-`sendTimeout`: timeout when calling `sendMessage`
29
37
-`refreshAssignmentsRetryInterval`: retry interval in case of failure getting shard assignments from storage
0 commit comments