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
210
0
Share
Future in WebApp (Java)
Short description about Future and CompletableFuture
Kengo TODA
July 17, 2016
More Decks by Kengo TODA
See All by Kengo TODA
生成AI 業務応用向けガイドライン 斜め読み / Overview of Generative AI Business Application Guidelines
eller86
0
160
KotlinユーザのためのJSpecify入門 / JSpecify 101 for Kotlin Devs
eller86
0
1.9k
JavaとGroovyで書かれたGradleプラグインをKotlinで書き直した話 / Converted a Gradle plugin from Groovy&Java to Kotlin
eller86
0
1.8k
ヒューマンスキル / The Humanskills
eller86
0
740
医療機関向けシステムの信頼性 / Reliability of systems for medical institutions
eller86
0
510
Server-side Kotlinを使うスタートアップでどんなDetektルールが育ったか / Detekt rules made in start-up working with Server-side Kotlin
eller86
0
1.6k
Java開発者向けのKotlin Gradleビルドスクリプト入門 / Gradle Build Script in Kotlin 101
eller86
1
2.1k
Goodbye JSR305, Hello JSpecify!
eller86
2
5.5k
Java8〜16におけるバイトコード生成の変化 / Changes of Bytecode Generation from Java 8 to 16
eller86
4
4.6k
Other Decks in Technology
See All in Technology
スクラムを支える内部品質の話
iij_pr
0
180
AWSで2番目にリリースされたサービスについてお話しします(諸説あります)
yama3133
0
110
最大のアウトプット術は問題を作ること
ryoaccount
0
270
Databricks Lakebaseを用いたAIエージェント連携
daiki_akimoto_nttd
0
120
Cortex Code君、今日から内製化支援担当ね。
coco_se
0
190
Move Fast and Break Things: 10 in 20
ramimac
0
120
AIエージェント時代に必要な オペレーションマネージャーのロールとは
kentarofujii
0
290
OpenClaw初心者向けセミナー / OpenClaw Beginner Seminar
cmhiranofumio
0
240
遊びで始めたNew Relic MCP、気づいたらChatOpsなオブザーバビリティボットができてました/From New Relic MCP to a ChatOps Observability Bot
aeonpeople
1
150
「できない」のアウトプット 同人誌『精神を壊してからの』シリーズ出版を 通して得られたこと
comi190327
3
540
Bref でサービスを運用している話
sgash708
0
220
第26回FA設備技術勉強会 - Claude/Claude_codeでデータ分析 -
happysamurai294
0
350
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Context Engineering - Making Every Token Count
addyosmani
9
790
How STYLIGHT went responsive
nonsquared
100
6k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
180
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
260
Navigating Team Friction
lara
192
16k
Faster Mobile Websites
deanohume
310
31k
Agile that works and the tools we love
rasmusluckow
331
21k
Crafting Experiences
bethany
1
100
The Invisible Side of Design
smashingmag
302
51k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
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