AS AgentScopeAPI 手册 / API Reference

SessionEventNotifier

@Service public class SessionEventNotifier
源码Source io/agentscope/builder/web/managed/service/SessionEventNotifier.java:46–170

会话事件 Notifier,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed.service 包。核心成员包括 publish、wakeups、SessionEventNotifier。

Wakes session-event readers without continuously polling the event table.

Every append emits an in-process signal. PostgreSQL deployments additionally publish and listen on a database channel so subscribers in other data-plane replicas wake immediately. A missed database notification is harmless: SessionEventLog periodically performs a low-frequency recovery read from its durable sequence cursor.

构造器摘要Constructor Summary

构造器Constructor说明Description
public SessionEventNotifier(DataSource dataSource, long reconnectDelayMs)
初始化 `SessionEventNotifier` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void publish(String sessionId)
设置发布。
Emits a local wakeup and best-effort PostgreSQL notification after the event commits.
public Flux<String> wakeups(String sessionId)
设置该参数。
Returns coalescible wakeups for one session.

构造器详情Constructor Detail

SessionEventNotifier

public SessionEventNotifier(DataSource dataSource, long reconnectDelayMs)

初始化 SessionEventNotifier 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
dataSourceDataSource数据来源(类型 `DataSource`)。The data source.
reconnectDelayMslong重连延迟 Ms(类型 `long`)。The reconnect delay ms.
源码Source io/agentscope/builder/web/managed/service/SessionEventNotifier.java:61–67

方法详情Method Detail

publish

public void publish(String sessionId)

设置发布。

Emits a local wakeup and best-effort PostgreSQL notification after the event commits.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
源码Source io/agentscope/builder/web/managed/service/SessionEventNotifier.java:94–109

wakeups

public Flux<String> wakeups(String sessionId)

设置该参数。

Returns coalescible wakeups for one session.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
返回Returns Flux<String>
返回Flux。Returns flux.
源码Source io/agentscope/builder/web/managed/service/SessionEventNotifier.java:112–114
基于官方固定版本源码静态生成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.