AS AgentScopeAPI 手册 / API Reference

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
nameString名称(类型 `String`)。logical slot identifier (e.g. `"memory-flush:USER:alice"` or `"skill-curator"`)
minGapDuration最小 Gap(类型 `Duration`)。minimum elapsed time since the last successful claim
返回Returns boolean
返回布尔值,表示判断结果。`true` if the caller won the claim and may proceed, `false` otherwise
源码Source io/agentscope/harness/agent/coordination/PeriodicGate.java:36
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.