PeriodicGate
public interface PeriodicGate
源码Source
io/agentscope/harness/agent/coordination/PeriodicGate.java:26–37定义 Periodic Gate契约的接口。位于 io.agentscope.harness.agent.coordination 包。核心成员包括 tryClaim。
Coordinates periodic background work across callers (and optionally across nodes) using a
minimum-gap throttle. A successful #tryClaim means the caller may proceed; a
false return means another caller recently claimed the slot or the gap has not
elapsed.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public boolean tryClaim(String name, Duration minGap) | 执行 `tryClaim` 方法。 Attempts to claim the named periodic slot. |
方法详情Method Detail
tryClaim
public boolean tryClaim(String name, Duration minGap)
执行 tryClaim 方法。
Attempts to claim the named periodic slot.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。logical slot identifier (e.g. `"memory-flush:USER:alice"` or `"skill-curator"`) |
minGap | Duration | 最小 Gap(类型 `Duration`)。minimum elapsed time since the last successful claim |
boolean返回布尔值,表示判断结果。`true` if the caller won the claim and may proceed, `false` otherwise
源码Source
io/agentscope/harness/agent/coordination/PeriodicGate.java:36