public class SseEmitter extends Object implements org.noear.solon.core.Lifecycle
| 构造器和说明 |
|---|
SseEmitter(long keepAlive) |
| 限定符和类型 | 方法和说明 |
|---|---|
SseEmitter |
onCompletion(Runnable onCompletion)
完成之前回调方法
|
SseEmitter |
onError(Consumer<Throwable> onError)
异常回调方法
|
void |
send(SseEvent event)
发送事件内容
|
void |
send(String data)
发送事件内容
|
void |
start()
任务开始
|
void |
stop()
任务关闭
|
public SseEmitter onCompletion(Runnable onCompletion)
onCompletion - public SseEmitter onError(Consumer<Throwable> onError)
onError - public void send(String data)
data - 事件数据public void send(SseEvent event)
event - 事件数据public void start()
throws Throwable
start 在接口中 org.noear.solon.core.LifecycleThrowableCopyright © 2023. All rights reserved.