#swiftconcurrency — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #swiftconcurrency, aggregated by home.social.
-
Moving code into an actor removes the data race. It does not make your function atomic.
Actors are reentrant by design. Every await inside an actor method releases the actor, so another task can enter, run, mutate and finish before your function resumes.
The classic shape is a cache: two callers miss the same key, both start the download, the second write clobbers the first. No crash, just twice the traffic.
Store the in-flight Task, not only the result.
-
Moving code into an actor removes the data race. It does not make your function atomic.
Actors are reentrant by design. Every await inside an actor method releases the actor, so another task can enter, run, mutate and finish before your function resumes.
The classic shape is a cache: two callers miss the same key, both start the download, the second write clobbers the first. No crash, just twice the traffic.
Store the in-flight Task, not only the result.
-
Moving code into an actor removes the data race. It does not make your function atomic.
Actors are reentrant by design. Every await inside an actor method releases the actor, so another task can enter, run, mutate and finish before your function resumes.
The classic shape is a cache: two callers miss the same key, both start the download, the second write clobbers the first. No crash, just twice the traffic.
Store the in-flight Task, not only the result.
-
Moving code into an actor removes the data race. It does not make your function atomic.
Actors are reentrant by design. Every await inside an actor method releases the actor, so another task can enter, run, mutate and finish before your function resumes.
The classic shape is a cache: two callers miss the same key, both start the download, the second write clobbers the first. No crash, just twice the traffic.
Store the in-flight Task, not only the result.
-
Moving code into an actor removes the data race. It does not make your function atomic.
Actors are reentrant by design. Every await inside an actor method releases the actor, so another task can enter, run, mutate and finish before your function resumes.
The classic shape is a cache: two callers miss the same key, both start the download, the second write clobbers the first. No crash, just twice the traffic.
Store the in-flight Task, not only the result.
-
`Task { }` doesn't move work off the main thread. It inherits the actor context. In SwiftUI that's @ MainActor.
In Xcode 26, `nonisolated async` doesn't either: it now runs on the caller's actor.
Want off? Mark the function `@ concurrent`. Offloading is explicit now.
-
`Task { }` doesn't move work off the main thread. It inherits the actor context. In SwiftUI that's @ MainActor.
In Xcode 26, `nonisolated async` doesn't either: it now runs on the caller's actor.
Want off? Mark the function `@ concurrent`. Offloading is explicit now.
-
async/await does not make work run off the main thread by default.
That mistake can still freeze your UI during real app work.
I explain how to avoid it in my free 5-day Swift Concurrency Playbook:
-
async/await does not make work run off the main thread by default.
That mistake can still freeze your UI during real app work.
I explain how to avoid it in my free 5-day Swift Concurrency Playbook:
-
async/await does not make work run off the main thread by default.
That mistake can still freeze your UI during real app work.
I explain how to avoid it in my free 5-day Swift Concurrency Playbook:
-
async/await does not make work run off the main thread by default.
That mistake can still freeze your UI during real app work.
I explain how to avoid it in my free 5-day Swift Concurrency Playbook:
-
Using async/await should make asynchronous Swift code easier to read and follow.
It's essential to know where suspension can happen and how errors move through your code.
I explain it with practical examples.
-
Using async/await should make asynchronous Swift code easier to read and follow.
It's essential to know where suspension can happen and how errors move through your code.
I explain it with practical examples.
-
Using async/await should make asynchronous Swift code easier to read and follow.
It's essential to know where suspension can happen and how errors move through your code.
I explain it with practical examples.
-
Using async/await should make asynchronous Swift code easier to read and follow.
It's essential to know where suspension can happen and how errors move through your code.
I explain it with practical examples.
-
Creating a Task inside onAppear often looks harmless until SwiftUI redraws and your app starts duplicate API calls.
I created a free 5-day Swift Concurrency Playbook to help you avoid mistakes like this in real app code:
-
Creating a Task inside onAppear often looks harmless until SwiftUI redraws and your app starts duplicate API calls.
I created a free 5-day Swift Concurrency Playbook to help you avoid mistakes like this in real app code:
-
Creating a Task inside onAppear often looks harmless until SwiftUI redraws and your app starts duplicate API calls.
I created a free 5-day Swift Concurrency Playbook to help you avoid mistakes like this in real app code:
-
Creating a Task inside onAppear often looks harmless until SwiftUI redraws and your app starts duplicate API calls.
I created a free 5-day Swift Concurrency Playbook to help you avoid mistakes like this in real app code:
-
Creating a Task inside onAppear often looks harmless until SwiftUI redraws and your app starts duplicate API calls.
I created a free 5-day Swift Concurrency Playbook to help you avoid mistakes like this in real app code:
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain how it replaces nested completion handlers with code that still runs asynchronously through clear examples.
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain how it replaces nested completion handlers with code that still runs asynchronously through clear examples.
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain how it replaces nested completion handlers with code that still runs asynchronously through clear examples.
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain how it replaces nested completion handlers with code that still runs asynchronously through clear examples.
-
async/await does not automatically move work off the main thread.
That mistake can still freeze your UI. I created a free 5-day Swift Concurrency Playbook to help you avoid it in real app work:
-
async/await does not automatically move work off the main thread.
That mistake can still freeze your UI. I created a free 5-day Swift Concurrency Playbook to help you avoid it in real app work:
-
async/await does not automatically move work off the main thread.
That mistake can still freeze your UI. I created a free 5-day Swift Concurrency Playbook to help you avoid it in real app work:
-
async/await does not automatically move work off the main thread.
That mistake can still freeze your UI. I created a free 5-day Swift Concurrency Playbook to help you avoid it in real app work:
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain the baseline with code examples, including mistakes to avoid when replacing nested completion handlers:
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain the baseline with code examples, including mistakes to avoid when replacing nested completion handlers:
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain the baseline with code examples, including mistakes to avoid when replacing nested completion handlers:
-
Using async/await should make asynchronous Swift code easier to read and follow.
I explain the baseline with code examples, including mistakes to avoid when replacing nested completion handlers:
-
@mattiem @DaylishApp next will be @zenitizer but that’s a little more ambitious as the code base is older … but I’m motivated to do this now.
I think the “post Swift 6.2 world” is a good time for folks who were curious about #SwiftConcurrency but haven’t embraced it yet to give it a go 🤓
-
@mattiem @DaylishApp next will be @zenitizer but that’s a little more ambitious as the code base is older … but I’m motivated to do this now.
I think the “post Swift 6.2 world” is a good time for folks who were curious about #SwiftConcurrency but haven’t embraced it yet to give it a go 🤓
-
@mattiem @DaylishApp next will be @zenitizer but that’s a little more ambitious as the code base is older … but I’m motivated to do this now.
I think the “post Swift 6.2 world” is a good time for folks who were curious about #SwiftConcurrency but haven’t embraced it yet to give it a go 🤓
-
@mattiem @DaylishApp next will be @zenitizer but that’s a little more ambitious as the code base is older … but I’m motivated to do this now.
I think the “post Swift 6.2 world” is a good time for folks who were curious about #SwiftConcurrency but haven’t embraced it yet to give it a go 🤓
-
@mattiem @DaylishApp next will be @zenitizer but that’s a little more ambitious as the code base is older … but I’m motivated to do this now.
I think the “post Swift 6.2 world” is a good time for folks who were curious about #SwiftConcurrency but haven’t embraced it yet to give it a go 🤓
-
“… we can entirely eliminate suspension points and make everything synchronous when dealing with an actor …”
Only a MONSTER can leave me waiting for another week with this cliffhanger!!! 🥲
On a serious note, I’ve been really enjoying this series from @pointfreeco and cannot wait for the rest of videos!
-
“… we can entirely eliminate suspension points and make everything synchronous when dealing with an actor …”
Only a MONSTER can leave me waiting for another week with this cliffhanger!!! 🥲
On a serious note, I’ve been really enjoying this series from @pointfreeco and cannot wait for the rest of videos!
-
“… we can entirely eliminate suspension points and make everything synchronous when dealing with an actor …”
Only a MONSTER can leave me waiting for another week with this cliffhanger!!! 🥲
On a serious note, I’ve been really enjoying this series from @pointfreeco and cannot wait for the rest of videos!
-
“… we can entirely eliminate suspension points and make everything synchronous when dealing with an actor …”
Only a MONSTER can leave me waiting for another week with this cliffhanger!!! 🥲
On a serious note, I’ve been really enjoying this series from @pointfreeco and cannot wait for the rest of videos!
-
“… we can entirely eliminate suspension points and make everything synchronous when dealing with an actor …”
Only a MONSTER can leave me waiting for another week with this cliffhanger!!! 🥲
On a serious note, I’ve been really enjoying this series from @pointfreeco and cannot wait for the rest of videos!
-
Really quickly this morning, I pulled out some swift async helpers I've been using in some personal apps into a separate repo, mostly to make it easier to keep them all in sync. I published it at https://forge.younata.com/you/AsyncExtensions
Probably the most interesting thing there is AsyncMultiChannel. Which is like https://github.com/apple/swift-async-algorithms/blob/main/Sources/AsyncAlgorithms/AsyncAlgorithms.docc/Guides/Channel.md, but it supports multiple subscribers. I should rename it, because it's intended to be used in more of a pub-sub architecture than as 1-1 communication.
-
Really quickly this morning, I pulled out some swift async helpers I've been using in some personal apps into a separate repo, mostly to make it easier to keep them all in sync. I published it at https://forge.younata.com/you/AsyncExtensions
Probably the most interesting thing there is AsyncMultiChannel. Which is like https://github.com/apple/swift-async-algorithms/blob/main/Sources/AsyncAlgorithms/AsyncAlgorithms.docc/Guides/Channel.md, but it supports multiple subscribers. I should rename it, because it's intended to be used in more of a pub-sub architecture than as 1-1 communication.
-
Really quickly this morning, I pulled out some swift async helpers I've been using in some personal apps into a separate repo, mostly to make it easier to keep them all in sync. I published it at https://forge.younata.com/you/AsyncExtensions
Probably the most interesting thing there is AsyncMultiChannel. Which is like https://github.com/apple/swift-async-algorithms/blob/main/Sources/AsyncAlgorithms/AsyncAlgorithms.docc/Guides/Channel.md, but it supports multiple subscribers. I should rename it, because it's intended to be used in more of a pub-sub architecture than as 1-1 communication.
-
Really quickly this morning, I pulled out some swift async helpers I've been using in some personal apps into a separate repo, mostly to make it easier to keep them all in sync. I published it at https://forge.younata.com/you/AsyncExtensions
Probably the most interesting thing there is AsyncMultiChannel. Which is like https://github.com/apple/swift-async-algorithms/blob/main/Sources/AsyncAlgorithms/AsyncAlgorithms.docc/Guides/Channel.md, but it supports multiple subscribers. I should rename it, because it's intended to be used in more of a pub-sub architecture than as 1-1 communication.
-
Really quickly this morning, I pulled out some swift async helpers I've been using in some personal apps into a separate repo, mostly to make it easier to keep them all in sync. I published it at https://forge.younata.com/you/AsyncExtensions
Probably the most interesting thing there is AsyncMultiChannel. Which is like https://github.com/apple/swift-async-algorithms/blob/main/Sources/AsyncAlgorithms/AsyncAlgorithms.docc/Guides/Channel.md, but it supports multiple subscribers. I should rename it, because it's intended to be used in more of a pub-sub architecture than as 1-1 communication.
-
🚀 I just released Swift Streamable Actors v1.0!
If you’ve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: ✅ 100% Type-safe (no type-erasure/AnyKeyPath) ✅ Memory safe (static factories avoid strong reference cycles) ✅ Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
-
🚀 I just released Swift Streamable Actors v1.0!
If you’ve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: ✅ 100% Type-safe (no type-erasure/AnyKeyPath) ✅ Memory safe (static factories avoid strong reference cycles) ✅ Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
-
🚀 I just released Swift Streamable Actors v1.0!
If you’ve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: ✅ 100% Type-safe (no type-erasure/AnyKeyPath) ✅ Memory safe (static factories avoid strong reference cycles) ✅ Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
-
🚀 I just released Swift Streamable Actors v1.0!
If you’ve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: ✅ 100% Type-safe (no type-erasure/AnyKeyPath) ✅ Memory safe (static factories avoid strong reference cycles) ✅ Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
-
🚀 I just released Swift Streamable Actors v1.0!
If you’ve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: ✅ 100% Type-safe (no type-erasure/AnyKeyPath) ✅ Memory safe (static factories avoid strong reference cycles) ✅ Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
-
🤦♂️ "Finally understand Swift concurrency" - because reading endless jargon-filled screeds is exactly how everyone wants to spend their afternoons. 🙄 Huge thanks to Matt for translating developer hieroglyphics into slightly less intimidating developer hieroglyphics! 🎉
https://fuckingapproachableswiftconcurrency.com/en/ #SwiftConcurrency #Understanding #DeveloperJargon #TechTranslation #CodingHumor #DeveloperCommunity #HackerNews #ngated -
🤦♂️ "Finally understand Swift concurrency" - because reading endless jargon-filled screeds is exactly how everyone wants to spend their afternoons. 🙄 Huge thanks to Matt for translating developer hieroglyphics into slightly less intimidating developer hieroglyphics! 🎉
https://fuckingapproachableswiftconcurrency.com/en/ #SwiftConcurrency #Understanding #DeveloperJargon #TechTranslation #CodingHumor #DeveloperCommunity #HackerNews #ngated -
🤦♂️ "Finally understand Swift concurrency" - because reading endless jargon-filled screeds is exactly how everyone wants to spend their afternoons. 🙄 Huge thanks to Matt for translating developer hieroglyphics into slightly less intimidating developer hieroglyphics! 🎉
https://fuckingapproachableswiftconcurrency.com/en/ #SwiftConcurrency #Understanding #DeveloperJargon #TechTranslation #CodingHumor #DeveloperCommunity #HackerNews #ngated -
🤦♂️ "Finally understand Swift concurrency" - because reading endless jargon-filled screeds is exactly how everyone wants to spend their afternoons. 🙄 Huge thanks to Matt for translating developer hieroglyphics into slightly less intimidating developer hieroglyphics! 🎉
https://fuckingapproachableswiftconcurrency.com/en/ #SwiftConcurrency #Understanding #DeveloperJargon #TechTranslation #CodingHumor #DeveloperCommunity #HackerNews #ngated -
Fucking Approachable Swift Concurrency
https://fuckingapproachableswiftconcurrency.com/en/
#HackerNews #FuckingApproachableSwiftConcurrency #SwiftConcurrency #Programming #DeveloperCommunity #TechNews
-
Fucking Approachable Swift Concurrency
https://fuckingapproachableswiftconcurrency.com/en/
#HackerNews #FuckingApproachableSwiftConcurrency #SwiftConcurrency #Programming #DeveloperCommunity #TechNews
-
Fucking Approachable Swift Concurrency
https://fuckingapproachableswiftconcurrency.com/en/
#HackerNews #FuckingApproachableSwiftConcurrency #SwiftConcurrency #Programming #DeveloperCommunity #TechNews
-
Fucking Approachable Swift Concurrency
https://fuckingapproachableswiftconcurrency.com/en/
#HackerNews #FuckingApproachableSwiftConcurrency #SwiftConcurrency #Programming #DeveloperCommunity #TechNews