Defer asynchronous actions when deriving Mono instances from futures

This commit is contained in:
Jon Chambers
2023-08-18 13:48:23 -04:00
committed by Chris Eager
parent ff1ef90a6d
commit a96ee57c7e
11 changed files with 29 additions and 30 deletions

View File

@@ -357,7 +357,7 @@ public class WebSocketConnection implements MessageAvailabilityListener, Displac
.tap(Micrometer.metrics(Metrics.globalRegistry))
.limitRate(MESSAGE_PUBLISHER_LIMIT_RATE)
.flatMapSequential(envelope ->
Mono.fromFuture(sendMessage(envelope)
Mono.fromFuture(() -> sendMessage(envelope)
.orTimeout(sendFuturesTimeoutMillis, TimeUnit.MILLISECONDS)))
.subscribeOn(messageDeliveryScheduler)
.subscribe(