structured-concurrency Questions
3
Solved
I'm rather new to parallel code, and I tried to convert some code based on executors to structured concurrency, but I lost an important property that I must somehow keep.
Given the following code u...
Blackett asked 28/2, 2024 at 9:6
1
Solved
In GCD I just call:
DispatchQueue.main.asyncAfter(deadline: .now() + someTimeInterval) { ... }
But we started to migrate to Structured Concurrency.
I tried the following code:
extension Task where...
Spherule asked 26/5, 2023 at 12:40
3
Solved
I have watched Explore structured concurrency in Swift video and other relevant videos / articles / books I was able to find (swift by Sundell, hacking with swift, Ray Renderlich), but all examples...
Commissariat asked 14/4, 2022 at 12:46
1
Solved
I am trying to understand structured concurrency in Kotlin and I am unable to wrap my head across this piece of code.
fun main(): Unit = runBlocking {
other(this)
}
suspend fun other(scope: Corou...
Retentivity asked 1/1, 2023 at 1:47
2
Solved
A Java 19 ShutdownOnFailure scope also allows for explicit cancellation of all tasks using the shutdown method. How can I know if the scope has been shutdown? The API includes an isShutdown method,...
Cystolith asked 16/11, 2022 at 17:15
1
Solved
Today I refactored a ViewModel for a SwiftUI view to structured concurrency. It fires a network request and when the request comes back, updates a @Published property to update the UI. Since I use ...
Unshod asked 29/3, 2022 at 19:29
1
Solved
There are different ways of launching a coroutine in Kotlin. I found a couple of examples where GlobalScope and CoroutineScope are used. But the latter one is being created directly when launching ...
Westernmost asked 5/1, 2022 at 12:43
1
Solved
I'd like to be able to let the function doSomething() from class B to not be async and to not block it's caller thread. But with the following code I get this error:
Cannot pass function of type '...
Bechler asked 12/10, 2021 at 11:54
1
Solved
The following code is legal in Swift 5.5 (beta):
class Dog {
var name = "rover"
var friend : Dog? = nil
}
actor MyActor {
let dog = Dog()
}
func test() async {
let act = MyActor()
ac...
Lisabeth asked 20/8, 2021 at 15:28
1
© 2022 - 2025 — McMap. All rights reserved.