@@ -78,6 +78,13 @@ export class ShardingConfig extends Context.Tag("@effect/cluster/ShardingConfig"
7878 * after which an entity will be interrupted.
7979 */
8080 readonly entityMaxIdleTime : DurationInput
81+ /**
82+ * If an entity does not register itself within this time after a message is
83+ * sent to it, the message will be marked as failed.
84+ *
85+ * Defaults to 1 minute.
86+ */
87+ readonly entityRegistrationTimeout : DurationInput
8188 /**
8289 * The maximum duration of time to wait for an entity to terminate.
8390 *
@@ -129,6 +136,7 @@ export const defaults: ShardingConfig["Type"] = {
129136 shardLockExpiration : Duration . seconds ( 35 ) ,
130137 entityMailboxCapacity : 4096 ,
131138 entityMaxIdleTime : Duration . minutes ( 1 ) ,
139+ entityRegistrationTimeout : Duration . minutes ( 1 ) ,
132140 entityTerminationTimeout : Duration . seconds ( 15 ) ,
133141 entityMessagePollInterval : Duration . seconds ( 10 ) ,
134142 entityReplyPollInterval : Duration . millis ( 200 ) ,
@@ -208,6 +216,12 @@ export const config: Config.Config<ShardingConfig["Type"]> = Config.all({
208216 "The maximum duration of inactivity (i.e. without receiving a message) after which an entity will be interrupted."
209217 )
210218 ) ,
219+ entityRegistrationTimeout : Config . duration ( "entityRegistrationTimeout" ) . pipe (
220+ Config . withDefault ( defaults . entityRegistrationTimeout ) ,
221+ Config . withDescription (
222+ "If an entity does not register itself within this time after a message is sent to it, the message will be marked as failed."
223+ )
224+ ) ,
211225 entityTerminationTimeout : Config . duration ( "entityTerminationTimeout" ) . pipe (
212226 Config . withDefault ( defaults . entityTerminationTimeout ) ,
213227 Config . withDescription ( "The maximum duration of time to wait for an entity to terminate." )
0 commit comments