WakeupDispatcher
public class WakeupDispatcher implements AutoCloseable
io/agentscope/harness/agent/gateway/WakeupDispatcher.java:47–186Wakeup 调度器,承载智能体的部署、调度与服务化运行。位于 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.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
messageBus | MessageBus | 消息总线(类型 `MessageBus`)。The message bus. |
target | WakeupTarget | 目标(类型 `WakeupTarget`)。The target. |
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.
io/agentscope/harness/agent/gateway/WakeupDispatcher.java:105–118close
public void close()
关闭连接并释放相关资源。
Releases resources and connections.
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.