reactive

JVM/Spring

[Toby Spring Reactive Programming] 비동기 RestTemplate과 비동기 MVC/Serlvet (5)

서론 https://www.youtube.com/watch?v=ExUfZkh7Puk 토비님의 유튜브 강의 내용을 정리한 글 입니다. 본론 @RestController public static class MyController { AsyncRestTemplate rt = new AsyncRestTemplate(); @GetMapping("/rest") public String rest(int idx) { return rt.getForEntity("http://localhost:8081/service?req={req}", String.class, "hello" + idx); } } AsyncRestTemplate을 사용하면, 톰캣 스레드 1개로 처리가 가능하다. 하지만, 백그라운드 스레드가 생성되어 처리하기..

JVM/Spring

[Toby Spring Reactive Programming] Reactive Streams 시작 (1)

서론 https://youtu.be/8fenTR3KOJo 토비의 스프링에 있는 토비님의 라이브 유튜브 강의를 보고 정리한 내용입니다. 본론 Iterable vs Observable Iterable public static void main(String[] args) { Iterable iter = () -> new Iterator() { int i = 0; final static int MAX = 10; public boolean hasNext() { return i < MAX; } public Integer next() { return ++i; } }; iter.forEach(System.out::println); } Iterable 인터페이스를 구현하면, for-each를 사용할 수 있다. 주로, C..

Hyo Kim
'reactive' 태그의 글 목록