Skip to content

Instantly share code, notes, and snippets.

@raulraja
Created September 5, 2016 13:49
Show Gist options
  • Select an option

  • Save raulraja/6b825f53fc5c4370f488b200928cb461 to your computer and use it in GitHub Desktop.

Select an option

Save raulraja/6b825f53fc5c4370f488b200928cb461 to your computer and use it in GitHub Desktop.
Wrong order of effects
import scala.concurrent.ExecutionContext.global
val af = fetchUserInfoService(userId)
val bf = simpleDbLookups
val cf = expensiveDbLookups
val df = dbWriteOperations
val ef = expensiveCpuOperations
for {
a <- af
b <- bf
c <- cf
d <- df
e <- ef
} yield result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment