It's good if you are just writing plain old code, but not if you are building DSLs. Having to call
await
is clunky. My use case is in spek:
val m by memoized { ... }
// it block is a suspending block
it("doSomething") { f.doSomething() }
it("doAnother") { f.doAnother() }
I'm currently working on adding coroutine support in Spek, Each
it
will receive a unique instance of
f
and one improvement I want to do is to allow the two `it`s to be run in parallel. At the moment, the delegate that is backing
f
tracks the instance, I can't really make the two `it`s run in parallel as they share state. What I want to achieve is to store the state in the
coroutineContext
.