chia7712 commented on pull request #9707: URL: https://github.com/apache/kafka/pull/9707#issuecomment-756071279
Personally, the callback is a bit weird to me. The callback mechanism makes “internal” thread to handle user-defined code. The user code to handle response/error is vary different from serialization so it seems to me that callback causes some problems. 1. one thread’s callback can hurt other threads when we share a prouder to different threads. 2. bad performance due to “single” thread 3. can’t isolate the internal thread from user 4. callback has some cryptic limits (for instance, this issue and #9842) I prefer the Future that user can handle it by user-defined thread. Also, it does not have limits like callback and user code can be isolated from internal thread. For another, we should consider CompletabeFuture as we are already in JDK 8. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org