Skip to content

Instantly share code, notes, and snippets.

@derekwyatt
Created August 7, 2012 18:40
Show Gist options
  • Select an option

  • Save derekwyatt/3288187 to your computer and use it in GitHub Desktop.

Select an option

Save derekwyatt/3288187 to your computer and use it in GitHub Desktop.
Business Logic Worker of the Master / Worker remote node pattern
class TestWorker(masterLocation: ActorPath) extends Worker(masterLocation) {
// We'll use the current dispatcher for the execution context.
// You can use whatever you want.
implicit val ec = context.dispatcher
def doWork(workSender: ActorRef, msg: Any): Unit = {
Future {
workSender ! msg
WorkComplete("done")
} pipeTo self
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment