amaliujia commented on code in PR #1534:
URL: https://github.com/apache/ratis/pull/1534#discussion_r3701280404
##########
ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java:
##########
@@ -303,6 +359,22 @@ static CompletableFuture<Long> writeToAsync(ByteBuf buf,
return CompletableFuture.supplyAsync(() -> writeTo(buf, options, stream),
e);
}
+ static CompletableFuture<ByteBuffer> commandToAsync(ByteBuffer command, long
streamOffset,
+ DataStream stream, Executor defaultExecutor) {
+ final Executor e =
Optional.ofNullable(stream.getExecutor()).orElse(defaultExecutor);
+ return CompletableFuture.runAsync(() -> {}, e)
+ .thenCompose(ignored -> stream.onCommand(command, streamOffset));
Review Comment:
Thanks. I really learned something from this comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]