AndrewJSchofield commented on PR #14690:
URL: https://github.com/apache/kafka/pull/14690#issuecomment-1793496177

   Hi @philipnee, thanks for you comment. It does raise an interesting point.
   
   My view is that CompletableFuture provides a really nice abstraction for 
asynchronous processing. Using it in this PR is entirely appropriate. However, 
I also take your overall point.
   
   The threading for CompletableFuture depends upon the details of how it is 
used. If a future is completed on the "wrong" thread, then processing which is 
dependent upon completion of that future will also execute on the same "wrong" 
thread. If one of the more complex methods such as `supplyAsync` is used, it 
runs on a thread from a worker pool. I don't think we're using that pattern 
here.
   
   If we actually need to achieve signalling back to a specific thread, we 
could use the CF to enqueue an event. That compromise seems pretty sensible to 
me, but I'm not sure whether we need this with the PR as written. I need to 
re-read the code before I'll be certain.


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to