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
190
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
生成AI 業務応用向けガイドライン 斜め読み / Overview of Generative AI Business Application Guidelines
eller86
0
110
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
1.5k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.5k
ヒューマンスキル / The Humanskills
eller86
0
690
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
400
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.5k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
1.9k
Goodbye JSR305, Hello JSpecify!
eller86
2
5.2k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4.5k
Other Decks in Technology
See All in Technology
【Λ(らむだ)】最近のアプデ情報 / RPALT20250729
lambda
0
170
【2025 Japan AWS Jr. Champions Ignition】点から線、線から面へ〜僕たちが起こすコラボレーション・ムーブメント〜
amixedcolor
1
110
Wasmで社内ツールを作って配布しよう
askua
0
160
反脆弱性(アンチフラジャイル)とデータ基盤構築
cuebic9bic
2
120
みんなのSRE 〜チーム全員でのSRE活動にするための4つの取り組み〜
kakehashi
PRO
2
110
LLMでAI-OCR、実際どうなの? / llm_ai_ocr_layerx_bet_ai_day_lt
sbrf248
0
370
P2P ではじめる WebRTC のつまづきどころ
tnoho
1
280
製造業の課題解決に向けた機械学習の活用と、製造業特化LLM開発への挑戦
knt44kw
0
110
経理出身PdMがAIプロダクト開発を_ハンズオンで学んだ話.pdf
shunsukenarita
1
260
データエンジニアがクラシルでやりたいことの現在地
gappy50
3
780
ユーザー理解の爆速化とPdMの価値
kakehashi
PRO
1
110
解消したはずが…技術と人間のエラーが交錯する恐怖体験
lamaglama39
0
150
Featured
See All Featured
Writing Fast Ruby
sferik
628
62k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
How GitHub (no longer) Works
holman
314
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
770
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
530
Navigating Team Friction
lara
188
15k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.8k
Adopting Sorbet at Scale
ufuk
77
9.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
860
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