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
120
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
1.6k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.6k
ヒューマンスキル / The Humanskills
eller86
0
700
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
420
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
組織観点からIAM Identity CenterとIAMの設計を考える
nrinetcom
PRO
1
180
SREとソフトウェア開発者の合同チームはどのようにS3のコストを削減したか?
muziyoshiz
1
100
生成AIとM5Stack / M5 Japan Tour 2025 Autumn 東京
you
PRO
0
220
GC25 Recap+: Advancing Go Garbage Collection with Green Tea
logica0419
1
410
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
11
77k
Pure Goで体験するWasmの未来
askua
1
180
AWSにおけるTrend Vision Oneの効果について
shimak
0
130
Green Tea Garbage Collector の今
zchee
PRO
2
390
10年の共創が示す、これからの開発者と企業の関係 ~ Crossroad
soracom
PRO
1
220
GA technologiesでのAI-Readyの取り組み@DataOps Night
yuto16
0
270
SOC2取得の全体像
shonansurvivors
1
390
ACA でMAGI システムを社内で展開しようとした話
mappie_kochi
1
270
Featured
See All Featured
Building an army of robots
kneath
306
46k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Site-Speed That Sticks
csswizardry
11
880
Mobile First: as difficult as doing things right
swwweet
224
10k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Building Applications with DynamoDB
mza
96
6.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Raft: Consensus for Rubyists
vanstee
139
7.1k
A Tale of Four Properties
chriscoyier
160
23k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
It's Worth the Effort
3n
187
28k
Embracing the Ebb and Flow
colly
88
4.8k
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