Skip to content

Commit 1a05b49

Browse files
committed
Add docs
1 parent 26ed6f9 commit 1a05b49

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vuepress/docs/docs/config.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ Ideally, we want to move each shard only once during the whole process.
2424
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.
2525
:::
2626
- `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+
:::
2735
- `entityTerminationTimeout`: time we give to an entity to handle the termination message before interrupting it
2836
- `sendTimeout`: timeout when calling `sendMessage`
2937
- `refreshAssignmentsRetryInterval`: retry interval in case of failure getting shard assignments from storage

0 commit comments

Comments
 (0)