Class RedisSandboxExecutionGuard.Builder

java.lang.Object
io.agentscope.extensions.redis.sandbox.RedisSandboxExecutionGuard.Builder
Enclosing class:
RedisSandboxExecutionGuard

public static final class RedisSandboxExecutionGuard.Builder extends Object
  • Method Details

    • keyPrefix

      public RedisSandboxExecutionGuard.Builder keyPrefix(String 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

      public RedisSandboxExecutionGuard.Builder retryInterval(Duration interval)
      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