(Java 8) Completable Future - jeongyeonKimm/be-was GitHub Wiki

CompletableFuture 클래슀

기쑴의 Futureλ₯Ό 기반으둜 μ™ΈλΆ€μ—μ„œ μ™„λ£Œμ‹œν‚¬ 수 있음

CompletionStage μΈν„°νŽ˜μ΄μŠ€λ„ κ΅¬ν˜„ν•˜κ³  μžˆλŠ”λ° μ΄λŠ” μž‘μ—…λ“€μ„ μ€‘μ²©μ‹œν‚€κ±°λ‚˜ μ™„λ£Œ ν›„ μ½œλ°±μ„ μœ„ν•΄ 좔가됨

즉, μ™ΈλΆ€μ—μ„œ μž‘μ—…μ„ μ™„λ£Œμ‹œν‚¬ 수 μžˆμ„ 뿐만 μ•„λ‹ˆλΌ 콜백 등둝 및 Future μ‘°ν•© 등이 κ°€λŠ₯해짐

비동기 μž‘μ—… μ‹€ν–‰

  • runAsync
  • supplyAsync

μž‘μ—… 콜백

  • thenApply
  • thenAccept
  • thenRun

μž‘μ—… μ‘°ν•©

  • thenCompose
  • thenCombine
  • allOf
  • anyOf

μ˜ˆμ™Έ 처리

  • exceptionally
  • handle, handleAsync

[[Java] CompletableFuture에 λŒ€ν•œ 이해 및 μ‚¬μš©λ²•](https://mangkyu.tistory.com/263)