Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In Scala/Akka, you could use the ask operator and compose the resulting Futures, something like this:

  for {
    a <- aProviderActor ? gimmeA
    b <- bProviderActor ? gimmeB
    aPlusB <- adderActor ? (add, a, b)
  } yield aPlusB


Yeah, but you're blocking the thread. It's very very easy for you to deadlock the entire system writing code like this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: