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
88
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
1.3k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.4k
ヒューマンスキル / The Humanskills
eller86
0
670
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
370
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.8k
Goodbye JSR305, Hello JSpecify!
eller86
2
5.1k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4.4k
Other Decks in Technology
See All in Technology
Computer Use〜OpenAIとAnthropicの比較と将来の展望〜
pharma_x_tech
6
1k
LINE 購物幕後推手
line_developers_tw
PRO
0
450
20 Years of Domain-Driven Design: What I’ve Learned About DDD
ewolff
1
350
非root化Androidスマホでも動く仮想マシンアプリを試してみた
arkw
0
120
名単体テスト 禁断の傀儡(モック)
iwamot
PRO
1
240
続・やっぱり余白が大切だった話
kakehashi
PRO
3
320
Kaigi Effect 2025 #rubykaigi2025_after
sue445
0
120
本当に必要なのは「QAという技術」だった!試行錯誤から生まれた、品質とデリバリーの両取りアプローチ / Turns Out, "QA as a Discipline" Was the Key!
ar_tama
9
4.5k
Vibe Coding Tools
ijin
0
220
とあるEdTechベンチャーのシステム構成こだわりN選 / edtech-system
gotok365
4
300
Developer 以外にこそ使って欲しい Amazon Q Developer
mita
0
120
猫でもわかるS3 Tables【Apache Iceberg編】
kentapapa
2
200
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Navigating Team Friction
lara
185
15k
Music & Morning Musume
bryan
47
6.5k
We Have a Design System, Now What?
morganepeng
52
7.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
700
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
A better future with KSS
kneath
239
17k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Unsuck your backbone
ammeep
671
58k
Designing for Performance
lara
608
69k
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