create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
import lombok.SneakyThrows; | |
import lombok.extern.log4j.Log4j2; | |
import org.junit.jupiter.api.Test; | |
import java.util.concurrent.Executors; | |
import java.util.stream.IntStream; | |
@Log4j2 | |
class TLTest { |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
GetMapping("/async-deferredresult") | |
public DeferredResult<ResponseEntity<?>> handleReqDefResult(Model model) { | |
LOG.info("Received async-deferredresult request"); | |
DeferredResult<ResponseEntity<?>> output = new DeferredResult<>(); //just a declaration | |
ForkJoinPool.commonPool().submit(() -> { //we pass a service method to an ExecutorService / thread pool | |
LOG.info("Processing in separate thread"); | |
try { | |
Thread.sleep(6000); | |
} catch (InterruptedException e) { |
//-------------------------------------------------------- | |
//Service that we want to execute asynchroneously - consists of the following method: | |
public String execute() { | |
try { | |
Thread.sleep(5000); | |
logger.info("Slow task executed"); | |
return "Task finished"; | |
} catch (InterruptedException e) { | |
throw new RuntimeException(); | |
} |