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
Promises, Futures, and the Shape of Your Code
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Greg Heo
May 21, 2018
Technology
71
0
Share
Promises, Futures, and the Shape of Your Code
Greg Heo
May 21, 2018
More Decks by Greg Heo
See All by Greg Heo
Concurrency From the Ground Up
gregheo
0
240
The least you need to know about hashing in Swift
gregheo
0
190
Shared Mutable State
gregheo
0
530
Shared, Exclusive, Mutable, Immutable
gregheo
0
160
Getting Under Swift’s Skin
gregheo
0
550
Sanitizing Threads for Fun & Profit
gregheo
0
160
Sanitizing All* The Things
gregheo
0
67
Thirteen Ways of Looking at a View Controller
gregheo
0
140
Five Unbelievable Secrets of Reactive Programming the Experts Don't Want You to Know!
gregheo
3
430
Other Decks in Technology
See All in Technology
Datadog 認定試験の概要と対策
uechishingo
0
220
イベントストーミングとKiroの仕様駆動開発で実現する要件の認識合わせプロセス
syobochim
7
1k
オンコールの負荷軽減のためのBits Assistant 活用方法 / How to Use Bits Assistant to Reduce the Workload on On-Call Staff
sms_tech
1
370
Unlocking the Apps
pimterry
0
150
Ruby::Boxでできること、Refinementsでできること
joker1007
3
330
美味しいスイスチーズを作ろう🧀🐭
taigamikami
1
200
コードレビューを制するチームがソフトウェアデリバリーのフローを制す / Beyond Code Review: Distributing Its Responsibilities Across the SDLC
mtx2s
3
570
自称宇宙最速で不合格となったAIP-C01にリベンジを果たすべくAIで問題集アプリを作ってみた。
yama3133
0
260
AI フレンドリーなエラー監視を TypeScript で実現する
shinyaigeek
2
200
Spring AI × MCP 入門〜AIエージェントへのツール公開、境界設計から始める最小構成 〜
yuyamiyamoto
0
190
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
610
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
290
Featured
See All Featured
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
160
Designing Experiences People Love
moore
143
24k
Visualization
eitanlees
152
17k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
310
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
190
Skip the Path - Find Your Career Trail
mkilby
1
130
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Optimizing for Happiness
mojombo
378
71k
Transcript
@gregheo C1 Mobile Summit
++++++++[>++++[>++>+ ++>+++>+<<<<-]>+>+>- >>+[<]<-]>>.>---.+++ ++++..+++.>>.<-.<.++ +.------.--------.>> +.>++.
None
None
None
None
None
!
networker.beginRequest(.read, success: { data in })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in }
})
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in } } })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in } } } })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } }) print("Hello 1") print("Hello 2")
⏰#
None
A B C X Y Z
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } }) print("Hello 1") print("Hello 2")
⏰#
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } })
Clojure
Future
(defn square [x] (* x x) )
(defn square [x] (future (* x x)) )
(defn saveToDisk [data] (future ( ... )) )
saveToDisk future completed? cancelled? value
@myFuture (deref myFuture)
A X Y future B C D (deref future)
Future
Promise
@myPromise (deref myPromise)
getValue promise realized? value promise deliver
Promise
❓
%&