Skip to content

Commit

Permalink
chore: clean codes
Browse files Browse the repository at this point in the history
  • Loading branch information
hantsy committed Jul 25, 2023
1 parent b8f353b commit 14f5a5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions websocket/src/main/java/com/example/demo/MessagetHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Mono<Void> handle(WebSocketSession session) {
var receiveMono = session.receive()
.map(WebSocketMessage::getPayloadAsText)
.map(this::readIncomingMessage)
.map(req -> Mono.fromCallable(() ->
.flatMap(req -> Mono.fromCallable(() ->
Message.builder().id(UUID.randomUUID()).body(req.message()).sentAt(LocalDateTime.now()).build()))
.log("server receiving::")
// .subscribe(
Expand All @@ -47,7 +47,7 @@ public Mono<Void> handle(WebSocketSession session) {
// );
.doOnNext(data -> {
executor.execute(() -> {
sinks.emitNext(data.block(), Sinks.EmitFailureHandler.FAIL_FAST);
sinks.emitNext(data, Sinks.EmitFailureHandler.FAIL_FAST);
});
})
.doOnError(error -> sinks.emitError(error, Sinks.EmitFailureHandler.FAIL_FAST))
Expand Down

0 comments on commit 14f5a5c

Please sign in to comment.