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
【Ebisu.mobile#3】バイトルアプリへのSwift Concurrency導入とその効果
Search
Cychow
July 05, 2023
Programming
3
340
【Ebisu.mobile#3】バイトルアプリへのSwift Concurrency導入とその効果
Cychow
July 05, 2023
Tweet
Share
More Decks by Cychow
See All by Cychow
【Qiita Night】新卒エンジニアによるSwift6与太予想
eiji127
0
360
Other Decks in Programming
See All in Programming
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
550
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
240
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
6k
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
940
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
950
Scaling your build logic
antalmonori
1
100
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1366
200k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
How to Ace a Technical Interview
jacobian
276
23k
Typedesign – Prime Four
hannesfritz
40
2.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Navigating Team Friction
lara
183
15k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Transcript
όΠτϧΞϓϦͷSwift Concurrency ಋೖͱͦͷޮՌ Eiji Shirakazu, iOS Engineer in dip
ࣗݾհ ന ӥ࢘ / Eiji Shirakazu @cychow_app όΠτϧ iOSΞϓϦ։ൃ୲ ࠷ۙVision
Pro (visionOS)ͷγϛϡϨʔλͰ༡ΜͰ͍·͢ʂ
None
ຊͷ༰ όΠτϧΞϓϦͷ͝հͱ։ൃपΓͷ͓ ͦͦSwift Concurrencyͱ Swift ConcurrencyΛͲͷΑ͏ʹಋೖ͔ͨ͠ Swift Concurrencyಋೖޙͷঢ়گ
όΠτϧΞϓϦͱ… ɾΞϧόΠτ/ύʔτٻਓݕࡧαʔϏε ɾ෯͍͔༷ͭʑͳ݅ͷΞϧόΠτ/ύʔτใɹ ɹΛଟ͘ܝࡌʂ ɾࣸਅಈըͳͲ͔ΒΞϧόΠτ/ύʔτઌͷ੍ಇ͍ͯ ɹ͍Δελοϑɺ৬ͷงғؾͳͲΛ֬ೝ͢Δ͜ͱ͕Ͱ͖Δʂ
ʮॳճΠϯετʔϧޙͷମݧ্ʯػೳʹ͍ͭͯ εϓϥογϡ ٻਓͷҰཡ
ʮॳճΠϯετʔϧޙͷମݧ্ʯػೳʹ͍ͭͯ εϓϥογϡ Ϣʔβʔͷ࣭
ʮॳճΠϯετʔϧޙͷମݧ্ʯػೳͷ։ൃͰ Swift ConcurrencyΛಋೖʂʂ
Swift Concurrencyͱ WWDC21ʹͯొͨ͠৽ͨͳฒߦॲཧͷख๏ async/awaitΩʔϫʔυΛ༻͍Δ͜ͱͰඇಉظॲཧ / ฒߦॲཧΛ࣮ݱ͢Δ async/awaitҎ֎ʹActorTaskɺAsyncStreamͳͲͷ֓೦ొ
None
None
Swift ConcurrencyΛͲͷΑ͏ʹಋೖ͔ͨ͠ ᶃ ·͕ͣࣗੵۃతʹConcurrencyʹ͍ͭͯΠϯϓοτͨ͠ ᶄ ಋೖ͢Δ͜ͱʹͲΕ͘Β͍ͷϝϦοτ͕͋Δ͔Λߟͨ͠
ɾඇಉظॲཧΛಉظॲཧͷΑ͏ʹදه͢Δ͜ͱͰ࣮ߦॱংΛ͍͍͢ Swift ConcurrencyΛಋೖ͢ΔϝϦοτ ɾσʔλڝ߹Λճආ͘͢͠ͳΔ ɾiOS13Ҏ߱Ͱ༻͢Δ͜ͱ͕Ͱ͖Δ ɾΤϥʔϋϯυϦϯάΛߦ͍͘͢ͳΔ ͳͲ…
Swift ConcurrencyΛͲͷΑ͏ʹಋೖ͔ͨ͠ ᶅ ઌഐΤϯδχΞͷํʑͱ૬ஊ͠ɺαʔϏεʹ༩͑ΔӨڹΛߟ্ྀͨ͠Ͱಋೖ ɹ͍ͯ͘͜͠ͱʹͨ͠ ᶃ ·͕ͣࣗੵۃతʹConcurrencyʹ͍ͭͯΠϯϓοτͨ͠ ᶄ ಋೖ͢Δ͜ͱʹͲΕ͘Β͍ͷϝϦοτ͕͋Δ͔Λߟͨ͠ ᶆ
Өڹൣғ͕খ͍͞ʮॳճΠϯετʔϧޙͷମݧʯΛ্ͤ͞ΔϓϩδΣΫτ ɹʹͯಋೖ͢Δ͜ͱͱͨ͠
ɾcompletionHandlerΛ༻͍ͣɺasync/awaitΛ༻͍ͯදه͢Δɻ ɾGCDΛ༻͢ΔՕॴΛTaskʹஔ͖͑Δɻ ɾMainActorΛࢦఆ͢ΔՕॴʹҙ͢Δɻ Swift ConcurrencyΛಋೖ࣌ͷϙΠϯτ ɾwithCheckedContinuationwithCheckedThrowingContinuationͰ ɹطଘͷඇಉظॲཧΛasync/awaitʹରԠͤ͞Δ͜ͱ͕Ͱ͖Δɻ ͳͲ
ͨͩɺ…
໘ͨ͠ ଞͷ։ൃνʔϜϝϯόʔ৽نࢀըऀͷํʹରͯ͠Concurrencyͷ ॻ͖ํͳͲΛͬͯΒ͏ඞཁ͕͋ͬͨɻ
ͷղܾࡦ LTେձࢀՃ
Swift Concurrencyಋೖޙͷঢ়گ ɾιʔείʔυͷՄಡੑ্͕ͨ͠ ɾνʔϜϝϯόʔ͕ੵۃతʹΩϟονΞοϓ͢ΔΑ͏ʹͳͬͨ ʲݱঢ়ʳ ɾαʔυύʔςΟϥΠϒϥϦ͔Βඪ४ϥΠϒϥϦʹҠߦ͢Δ͜ͱ͕Ͱ͖͍ͯΔ
Swift Concurrencyಋೖޙͷঢ়گ ɾSwift6ͷϝδϟʔΞοϓσʔτͷ४උ ʲࠓޙͷ՝ʳ
None
Swift Concurrencyಋೖޙͷঢ়گ ɾࠓޙͷSwift6ͷϝδϟʔΞοϓσʔτͷ४උ ɾίϯύΠϥϑϥάʮStrict Concurrency CheckingʯͷಋೖͳͲݕ౼ ʲࠓޙʳ
ίϯύΠϥϑϥάʮStrict Concurrency Checkingʯ
ίϯύΠϥϑϥάʮExistentialAnyʯಋೖݕ౼த….
Swift Concurrencyಋೖޙͷঢ়گ ɾࠓޙͷSwift6ͷϝδϟʔΞοϓσʔτͷ४උ ɾίϯύΠϥϑϥάʮStrict Concurrency CheckingʯͷಋೖͳͲݕ౼ ɾSendableͷ४ڌͷνΣοΫͳͲ͓͜ͳ͍͖͍ͬͯͨ ʲࠓޙʳ
όΠτϧͰҾ͖ଓ͖ٕज़తઓΛଓ͚͍͖ͯ·͢ʂ
None