Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import java.util.concurrent.CompletableFuture;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
public class DemoService {
* 非同期処理
* @param seconds
* @return
* @throws InterruptedException
public CompletableFuture<String> async(String seconds) throws InterruptedException {
Thread.sleep(Long.valueOf(seconds) * 1000L);
return CompletableFuture.completedFuture(seconds + "秒かかる処理");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment