igorvd
05/29/2018, 12:07 PMclean architecture
, how you guys model the coroutines execution for use cases?
You guys only mark the execute method with suspend and let the caller decide how to start the suspend function, or make the suspend function return a deferred or result?voddan
05/29/2018, 2:20 PMsuspend
as a part of a function contract and marks with it every function which potentially can do IO (http or database access), even if the current implementation of the function is blocking. That plays out very nicely when, for example, we update a framework and it re-implements some operation in an async way, all we have to do is to add an adapter in one place, and all the other code keeps working.bdawg.io
05/29/2018, 7:10 PMsuspend
if your function is actually going to suspend — so if you choose to do IO, make sure it’s IO that can suspend and not just be marked suspend but actually be blockingsuspend
isn’t free