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
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
840
ヒューマンスキル / The Humanskills
eller86
0
500
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
270
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.2k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
1.4k
Goodbye JSR305, Hello JSpecify!
eller86
2
4.5k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4k
Javaプログラミングの体験向上に関する活動 / DX enhancement around Java programming
eller86
0
3.6k
静的解析ツールで生産性向上
eller86
1
840
Other Decks in Technology
See All in Technology
AIアシスタントの活用で品質の向上と開発ワークフローのスピードアップ
nagix
1
200
Amazon FSx for NetApp ONTAPのパフォーマンスチューニング要素をまとめてみた #cm_odyssey #devio2024
non97
0
220
GoとアクターモデルでES+CQRSを実践! / proto_actor_es_cqrs
ytake
1
160
Flutter研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
160
AWSでRAGを作る法方
sonoda_mj
1
140
AutomatedLabを使って内部ペンテストを勉強しよう! -やられ社内ネットワークの自動構築-
n_etupirka
1
610
Azure AI ことはじめ
tsubakimoto_s
0
130
成長期に歩みを止めないための創業期の開発文化形成
mayah
6
420
目標設定は好きですか? アジャイルとともに目標と向き合い続ける方法 / Do you like target Management?
kakehashi
10
3k
スタートアップにおける組織設計とスクラムの長期戦略 / Scrum Fest Kanazawa 2024
yoshikiiida
13
3.6k
クラウド利用者の「責任」をどう果たす?AWSセキュリティ対策のススメ #AWSSummit
hiashisan
0
280
dxd2024-生成AIに振り回された3か月間の成功と失敗/dxd2024-link-and-motivation
lmi
2
260
Featured
See All Featured
Building Adaptive Systems
keathley
34
2k
A better future with KSS
kneath
231
17k
How GitHub (no longer) Works
holman
305
140k
Thoughts on Productivity
jonyablonski
64
4.1k
Infographics Made Easy
chrislema
238
18k
What the flash - Photography Introduction
edds
65
11k
Building Your Own Lightsaber
phodgson
101
5.9k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Code Review Best Practice
trishagee
58
16k
Testing 201, or: Great Expectations
jmmastey
33
6.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
Writing Fast Ruby
sferik
623
60k
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