public final class SseSubscription extends Object implements AutoCloseable
| Constructor and Description |
|---|
SseSubscription(Runnable cancellation)
创建 sse subscription 实例,并按传入依赖确定资源所有权。
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel()
取消当前异步操作或 SSE 订阅。
|
void |
close()
释放当前对象持有的连接、订阅或执行资源;重复调用是安全的。
|
boolean |
isActive()
判断当前订阅是否仍可接收事件。
|
public SseSubscription(Runnable cancellation)
cancellation - 取消信号;为 null 时不可由外部取消public boolean cancel()
true,否则返回 falsepublic boolean isActive()
true,否则返回 falsepublic void close()
close in interface AutoCloseableCopyright © 2026. All rights reserved.