Skip to content

Commit fac87f5

Browse files
committedDec 11, 2021
Implemented async function to get the details of a Github User
1 parent a836718 commit fac87f5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎springboot-async-example/src/main/java/net/alanbinu/springboot/springbootasyncexample/SpringbootAsyncApplication.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.guides.springboot.springbootasyncexample;
1+
package net.alanbinu.springboot.springbootasyncexample;
22

33
import java.util.concurrent.CompletableFuture;
44

@@ -13,8 +13,8 @@
1313
import org.springframework.scheduling.annotation.EnableAsync;
1414
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
1515

16-
import net.guides.springboot.springbootasyncexample.model.User;
17-
import net.guides.springboot.springbootasyncexample.service.GitHubLookupService;
16+
import net.alanbinu.springboot.springbootasyncexample.model.User;
17+
import net.alanbinu.springboot.springbootasyncexample.service.GitHubLookupService;
1818

1919
@SpringBootApplication
2020
@EnableAsync
@@ -48,7 +48,7 @@ public void run(String... args) throws Exception {
4848
CompletableFuture<User> page1 = gitHubLookupService.findUser("PivotalSoftware");
4949
CompletableFuture<User> page2 = gitHubLookupService.findUser("CloudFoundry");
5050
CompletableFuture<User> page3 = gitHubLookupService.findUser("Spring-Projects");
51-
CompletableFuture<User> page4 = gitHubLookupService.findUser("RameshMF");
51+
CompletableFuture<User> page4 = gitHubLookupService.findUser("AlanBinu007");
5252
// Wait until they are all done
5353
CompletableFuture.allOf(page1, page2, page3, page4).join();
5454

‎springboot-async-example/src/main/java/net/alanbinu/springboot/springbootasyncexample/model/User.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.guides.springboot.springbootasyncexample.model;
1+
package net.alanbinu.springboot.springbootasyncexample.model;
22

33
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
44

‎springboot-async-example/src/main/java/net/alanbinu/springboot/springbootasyncexample/service/GitHubLookupService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.guides.springboot.springbootasyncexample.service;
1+
package net.alanbinu.springboot.springbootasyncexample.service;
22

33
import java.util.concurrent.CompletableFuture;
44

@@ -9,7 +9,7 @@
99
import org.springframework.stereotype.Service;
1010
import org.springframework.web.client.RestTemplate;
1111

12-
import net.guides.springboot.springbootasyncexample.model.User;
12+
import net.alanbinu.springboot.springbootasyncexample.model.User;
1313

1414
@Service
1515
public class GitHubLookupService {

0 commit comments

Comments
 (0)
Please sign in to comment.