Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Future in WebApp (Java)
Search
Kengo TODA
July 17, 2016
Technology
0
180
Future in WebApp (Java)
Short description about Future and CompletableFuture
Kengo TODA
July 17, 2016
Tweet
Share
More Decks by Kengo TODA
See All by Kengo TODA
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
450
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.1k
ヒューマンスキル / The Humanskills
eller86
0
560
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
320
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.3k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
1.5k
Goodbye JSR305, Hello JSpecify!
eller86
2
4.9k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4.3k
Javaプログラミングの体験向上に関する活動 / DX enhancement around Java programming
eller86
0
3.8k
Other Decks in Technology
See All in Technology
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
1
230
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
730
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
180
UI State設計とテスト方針
rmakiyama
2
370
Storage Browser for Amazon S3
miu_crescent
1
130
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
100
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
420
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
CustomCopを使ってMongoidのコーディングルールを整えてみた
jinoketani
0
220
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Six Lessons from altMBA
skipperchong
27
3.5k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Side Projects
sachag
452
42k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Making Projects Easy
brettharned
116
5.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
We Have a Design System, Now What?
morganepeng
51
7.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Transcript
Future in WebApp Kengo TODA
Agenda • What is Future • What is CompletableFuture •
Common usage in WebApp
What is Future? • Proxy interface to get result of
async operation • Similar with JavaScript’s Promise
Ask, and it will be given to you
How to implement method which returns Future instance? • Asynchronous
Method Invocation (Java EE 6) • Creating Asynchronous Methods (Spring Framework)
What is CompletableFuture • New class from Java8, implements Future
interface • Similar with ListenableFuture in Guava and Spring Framework
Apply result to Function,
or combine them.
Merit: connect result of Async I/O seamlessly auth add new
post load timeline START END
None
When we use them? • When call async I/O •
Datastore • Message Queue • Cache • RESTful API
Example: When we use them? • If you are service
provider, • Public service API (interface for user) should return CompletableFuture instance if it may use I/O internally. • Then during I/O is running, your user can use current thread for other usage.
Keywords to google • Promise, Future • CompletableFuture • ListenableFuture
(Guava & Spring Framework) • Function composition