Easy to understand explanation of completable future

We have Future and Executor to execute our asynchronous tasks. Why do we need this? When we use Future to obtain asynchronous execution results, there are two methods: call Get() or poll whether isDOne() is True Both methods are not very good, because the main thread will also be forced to wait. In order to reduce this wait, JAVA8 introduces t ...

Posted on Sat, 04 Dec 2021 18:56:48 -0500 by coolphpdude

Netty Principle 5: ChannelFuture and DefaultChannelPromise object parsing

1. Preface When learning Netty, you will certainly see these codes: //Start server listening ChannelFuture future = serverBootstrap.bind(7000).sync(); //close? future.channel().closeFuture().sync(); Question 1: the object returned by serverBootstrap.bind() is ChannelFuture. What is the effect of calling its syn ...

Posted on Thu, 07 Oct 2021 20:38:49 -0400 by pck76