Created
August 7, 2012 18:40
-
-
Save derekwyatt/3288187 to your computer and use it in GitHub Desktop.
Business Logic Worker of the Master / Worker remote node pattern
This file contains hidden or 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
| 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