【代码优化】XingHuoApi stream 变量没有其他地方使用,直接return
This commit is contained in:
parent
6633bf002d
commit
cbf7a1c587
|
@ -134,7 +134,7 @@ public class XingHuoApi {
|
|||
URI uri = URI.create(authUrl);
|
||||
// 发起 wss 请求并处理响应
|
||||
// 创建一个 Flux 来处理接收到的消息
|
||||
Flux<XingHuoChatCompletion> messageFlux = Flux.create(sink -> {
|
||||
return Flux.create(sink -> {
|
||||
socketClient.execute(uri, session ->
|
||||
session.send(Mono.just(session.textMessage(JSONUtil.toJsonStr(request))))
|
||||
.thenMany(session.receive()
|
||||
|
@ -145,6 +145,5 @@ public class XingHuoApi {
|
|||
.then())
|
||||
.subscribe(); // 订阅以开始会话
|
||||
});
|
||||
return messageFlux;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue