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
0
54
Promises, Futures, and the Shape of Your Code
Greg Heo
May 21, 2018
Tweet
Share
More Decks by Greg Heo
See All by Greg Heo
Concurrency From the Ground Up
gregheo
0
160
The least you need to know about hashing in Swift
gregheo
0
100
Shared Mutable State
gregheo
0
350
Shared, Exclusive, Mutable, Immutable
gregheo
0
130
Getting Under Swift’s Skin
gregheo
0
520
Sanitizing Threads for Fun & Profit
gregheo
0
110
Sanitizing All* The Things
gregheo
0
56
Thirteen Ways of Looking at a View Controller
gregheo
0
120
Five Unbelievable Secrets of Reactive Programming the Experts Don't Want You to Know!
gregheo
3
340
Other Decks in Technology
See All in Technology
音声AIエージェントの世界とRetell AI入門 / Introduction to the World of Voice AI Agents and Retell AI
rkaga
4
780
日経電子版から始まった内製開発の現在地と向き合っている課題/inhouse
nishiuma
0
240
自社開発した大規模言語モデルをどうプロダクションに乗せて運用していくか〜インフラ編〜
pfn
PRO
4
1k
contenteditableと向き合う
kikuchikakeru
2
210
トレタO/X アーキテクチャ移行記 Next.js App Router化への道のり / TORETA TECH UPDATE 1
okunokentaro
2
680
RAGHack: Building RAG apps in Python
pamelafox
0
120
Azure SQL Database Hyperscale HA レプリカの監視
sansantech
PRO
0
210
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
0
3.2k
Oracle Database Backup Service:サービス概要のご紹介
oracle4engineer
PRO
0
4k
Oracle Database 23ai 新機能 #3 Oracle Globally Distributed Database(GDD)
oracle4engineer
PRO
1
160
Dify - LINE Bot連携 考え方と実用テクニック
uezo
5
1.1k
分野に潜むツールの紹介
pojiro
1
340
Featured
See All Featured
Design by the Numbers
sachag
277
19k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
363
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
42
2k
Designing for Performance
lara
604
68k
Fireside Chat
paigeccino
31
2.9k
Robots, Beer and Maslow
schacon
PRO
157
8.1k
How STYLIGHT went responsive
nonsquared
93
5.1k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.7k
Why Our Code Smells
bkeepers
PRO
334
56k
Fashionably flexible responsive web design (full day workshop)
malarkey
400
65k
Designing the Hi-DPI Web
ddemaree
278
34k
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
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
❓
%&