Created
August 29, 2014 04:15
-
-
Save abh1nav/afac61b2fa588dd232a0 to your computer and use it in GitHub Desktop.
Zip with Index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trying to debug an actor system where workers are spawned from a list of work objects | |
// and only some workers exit cleanly while others crash | |
case class Work(...) | |
val workload = List[Work](...) | |
workload.zipWithIndex.foreach({ | |
case (work, index) => | |
val worker = context.actorOf(Props[WorkActor], s"worker$index") | |
worker ! work | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment