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
68
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
180
Shared Mutable State
gregheo
0
530
Shared, Exclusive, Mutable, Immutable
gregheo
0
150
Getting Under Swift’s Skin
gregheo
0
550
Sanitizing Threads for Fun & Profit
gregheo
0
160
Sanitizing All* The Things
gregheo
0
65
Thirteen Ways of Looking at a View Controller
gregheo
0
130
Five Unbelievable Secrets of Reactive Programming the Experts Don't Want You to Know!
gregheo
3
420
Other Decks in Technology
See All in Technology
Hooks, Filters & Now Context: Why MCPs Are the “Hooks” of the AI Era
miriamschwab
0
160
Digitization部 紹介資料
sansan33
PRO
1
7.2k
新メンバーのために、シニアエンジニアが環境を作る時代
puku0x
0
760
20260410 - CNTUG meetup #72 - DiskImage Builder 介紹:以 Kubespray CI 打造 RockyLinux 10 Cloud Image 為例
tico88612
0
120
GitHub Copilotを極める会 - 開発者のための活用術
findy_eventslides
7
4.1k
Discordでリモートポケカしてたら、なぜかDOを25分間動かせるようになった話
umireon
0
130
ふりかえりがなかった職能横断チームにふりかえりを導入してみて学んだこと 〜チームのふりかえりを「みんなで未来を考える場」にするプロローグ設計〜
masahiro1214shimokawa
0
370
NOSTR, réseau social et espace de liberté décentralisé
rlifchitz
0
170
CloudSec JP #005 後締め ~ソフトウェアサプライチェーン攻撃から開発者のシークレットを守る~
lhazy
0
180
暗黙知について一歩踏み込んで考える - 暗黙知の4タイプと暗黙考・暗黙動へ
masayamoriofficial
0
1.5k
ルールルルルル私的函館観光ガイド── 函館の街はイクラでも楽しめる!
nomuson
0
180
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
Featured
See All Featured
Believing is Seeing
oripsolob
1
110
Exploring anti-patterns in Rails
aemeredith
3
310
Six Lessons from altMBA
skipperchong
29
4.2k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
300
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
520
AI: The stuff that nobody shows you
jnunemaker
PRO
5
530
Prompt Engineering for Job Search
mfonobong
0
260
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
130
GraphQLとの向き合い方2022年版
quramy
50
14k
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
❓
%&