Let’s try to understand Spring IOC by looking at the code instead of talking big.
As we all know, spring container load bean from xml file. How this
Let’s look at the structure of BeanFactory.
The sky isn't that so high so I will never give up
Let’s try to understand Spring IOC by looking at the code instead of talking big.
As we all know, spring container load bean from xml file. How this
Let’s look at the structure of BeanFactory.
hello
Future interface provider developers ability to run async tasks. It provides two method: isDone() and get().
The motivation to have completable future is that Future interface is insufficient in the following cases.
CompletableFuture has many methods to support the above disadvantages. Now let’s look at some most used methods of CompletableFuture.
complete()
With this method, we can manually complete the async task.
CompletableFuture future = new CompletableFuture();
future.complete("Manually complete task.");
CompletableFuture provides us two method to set callback function for async task: supplyAsync() and runAsync(). The different is that supplyAsync() will return value, and runAsync() just run an async task. Let’s look at the code.
supplyAsync()