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
Greg Heo
May 21, 2018
Technology
72
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
250
The least you need to know about hashing in Swift
gregheo
0
200
Shared Mutable State
gregheo
0
530
Shared, Exclusive, Mutable, Immutable
gregheo
0
160
Getting Under Swift’s Skin
gregheo
0
560
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
200個のGitHubリポジトリを横断調査したかった
icck
0
110
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
1
120
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
2
590
How Timee Delivers Day 1 Production Ready LLM Features
tomoyks
0
130
On-behalf-of Token exchange with AgentCore Identity
hironobuiga
2
150
AWSシリコン最前線 〜AI時代のチップ選択を読み解く〜
htokoyo
2
460
Android の公式 Skill / Android skills
yanzm
0
130
小さくはじめるSLI/SLO ~育てながら組織に定着させる実践知~ / Starting Small with SLI/SLOs: Building Adoption Through Continuous Growth
nari_ex
5
1.7k
AIっぽい文章を採点して人間らしく直すアプリを作ってみた
yama3133
2
130
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
220
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
1
230
新しいVibe Codingと”自走”について
watany
5
290
Featured
See All Featured
The Invisible Side of Design
smashingmag
302
52k
Designing for Performance
lara
611
70k
Skip the Path - Find Your Career Trail
mkilby
1
140
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
570
Being A Developer After 40
akosma
91
590k
How to make the Groovebox
asonas
2
2.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
850
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Mind Mapping
helmedeiros
PRO
1
240
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
❓
%&