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
60
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
190
The least you need to know about hashing in Swift
gregheo
0
130
Shared Mutable State
gregheo
0
450
Shared, Exclusive, Mutable, Immutable
gregheo
0
140
Getting Under Swift’s Skin
gregheo
0
520
Sanitizing Threads for Fun & Profit
gregheo
0
120
Sanitizing All* The Things
gregheo
0
59
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
390
Other Decks in Technology
See All in Technology
Creating Awesome Change in SmartNews
martin_lover
1
240
Spice up your notifications/try!Swift25
noppefoxwolf
2
350
All You Need Is Kusa 〜Slackデータで始めるデータドリブン〜
jonnojun
0
140
食べログが挑む!飲食店ネット予約システムで自動テスト無双して手動テストゼロを実現する戦略
hagevvashi
3
310
アセスメントで紐解く、10Xのデータマネジメントの軌跡
10xinc
1
370
AI Agentを「期待通り」に動かすために:設計アプローチの模索と現在地
kworkdev
PRO
2
400
やさしいMCP入門
minorun365
PRO
149
97k
LangfuseでAIエージェントの 可観測性を高めよう!/Enhancing AI Agent Observability with Langfuse!
jnymyk
1
180
自分の軸足を見つけろ
tsuemura
2
630
AIと開発者の共創: エージェント時代におけるAIフレンドリーなDevOpsの実践
bicstone
1
260
7,000名規模の 人材サービス企業における プロダクト戦略・戦術と課題 / Product strategy, tactics and challenges for a 7,000-employee staffing company
techtekt
0
270
Automatically generating types by running tests
sinsoku
2
550
Featured
See All Featured
Building an army of robots
kneath
304
45k
Into the Great Unknown - MozCon
thekraken
37
1.7k
Code Reviewing Like a Champion
maltzj
522
39k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
104
19k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
How to Ace a Technical Interview
jacobian
276
23k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
520
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
390
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
650
Faster Mobile Websites
deanohume
306
31k
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
❓
%&