We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e73d83 commit 0734967Copy full SHA for 0734967
src/main/java/com/thughari/randomchat/controller/Ping.java
@@ -2,6 +2,10 @@
2
3
import org.springframework.web.bind.annotation.RequestMapping;
4
import org.springframework.web.bind.annotation.RestController;
5
+
6
+import java.util.concurrent.CompletableFuture;
7
8
+import org.springframework.scheduling.annotation.Async;
9
import org.springframework.web.bind.annotation.GetMapping;
10
11
@@ -10,8 +14,9 @@
14
public class Ping {
15
12
16
@GetMapping
13
- public String ping() {
- return "pong";
17
+ @Async("virtualThreadTaskExecutor")
18
+ public CompletableFuture<String> ping() {
19
+ return CompletableFuture.completedFuture("pong");
20
}
21
22
0 commit comments