AS AgentScopeAPI 手册 / API Reference

WakeupDispatcher

public class WakeupDispatcher implements AutoCloseable
源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:47–186

Wakeup 调度器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.gateway 包,实现 AutoCloseable。核心成员包括 start、close、WakeupDispatcher。

Per-process dispatcher that wakes idle sessions when background work completes.

Subscribes to the shared wakeup signal channel on MessageBus#subscribeWakeup() and drains the durable wakeup queue on each signal. For each queued entry whose target session is idle, triggers a new reasoning round via WakeupTarget#runWakeup(String).

It serves as the universal activator for all cross-session communication:

  • Background subagent task completion

  • Async tool results (io.agentscope.harness.agent.middleware.AsyncToolMiddleware)

  • Team messages (future Agent Teams support)

  • Scheduled task triggers

Lifecycle: call #start() after the gateway is fully configured. Call #close() on shutdown. Typically managed by the application bootstrap or gateway factory.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
WakeupTarget接口interface
定义 Wakeup 目标契约的接口。
Thin interface for the two gateway operations the dispatcher needs.

构造器摘要Constructor Summary

构造器Constructor说明Description
public WakeupDispatcher(MessageBus messageBus, WakeupTarget target)
初始化 `WakeupDispatcher` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void start()
执行启动相关操作。
Starts the dispatcher: performs an initial drain of any queued wakeups (to pick up signals produced while this process was down), then subscribes to the live signal channel.
public void close()
关闭连接并释放相关资源。
Releases resources and connections.

构造器详情Constructor Detail

WakeupDispatcher

public WakeupDispatcher(MessageBus messageBus, WakeupTarget target)

初始化 WakeupDispatcher 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
messageBusMessageBus消息总线(类型 `MessageBus`)。The message bus.
targetWakeupTarget目标(类型 `WakeupTarget`)。The target.
源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:96–99

方法详情Method Detail

start

public void start()

执行启动相关操作。

Starts the dispatcher: performs an initial drain of any queued wakeups (to pick up signals produced while this process was down), then subscribes to the live signal channel.

源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:105–118

close

public void close()

关闭连接并释放相关资源。

Releases resources and connections.

源码Source io/agentscope/harness/agent/gateway/WakeupDispatcher.java:120–128

嵌套类详情Nested Class Detail

WakeupTarget

public interface WakeupTarget

定义 Wakeup 目标契约的接口。位于 io.agentscope.harness.agent.gateway 包。核心成员包括 isSessionRunning、runWakeup。

Thin interface for the two gateway operations the dispatcher needs. HarnessGateway implements this directly; tests can supply a stub.

基于官方固定版本源码静态生成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.