Class RedisSandboxExecutionGuard.Builder
java.lang.Object
io.agentscope.extensions.redis.sandbox.RedisSandboxExecutionGuard.Builder
- Enclosing class:
- RedisSandboxExecutionGuard
Builder for
RedisSandboxExecutionGuard.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theRedisSandboxExecutionGuard.Sets the Redis key prefix used for lock keys.Sets the TTL for each Redis lock key.retryInterval(Duration interval) Sets the polling interval between lock acquisition attempts.
-
Method Details
-
keyPrefix
Sets the Redis key prefix used for lock keys.Default:
"agentscope:sandbox:lock:". Useful when multiple environments or tenants share the same Redis instance and need namespace separation.- Parameters:
keyPrefix- the key prefix; must not be null or blank
-
leaseTtl
Sets the TTL for each Redis lock key.Default:
30 minutes. Must exceed the worst-case agent call duration (including LLM latency, retries, and snapshot operations). When a call outlasts the TTL the key is evicted and the next waiter may enter — this is a safety valve, not a correctness guarantee.- Parameters:
ttl- the lease TTL; must be positive
-
retryInterval
Sets the polling interval between lock acquisition attempts.Default:
500 ms. Lower values reduce latency at the cost of more Redis round-trips; higher values reduce load at the cost of increased queuing delay.- Parameters:
interval- the retry interval; must be positive
-
build
Builds theRedisSandboxExecutionGuard.
-