Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksandar Prokopec
committed
May 2, 2012
1 parent
d0fd3b3
commit 69564d4
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
package client | |||
|
|||
|
|||
|
|||
object Client extends App { | |||
val peer = actors.remote.Node("localhost", 23456) | |||
val a = actors.remote.RemoteActor.select(peer, 'test) | |||
a ! server.TestMsg | |||
} |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
package server | |||
|
|||
|
|||
|
|||
object Server extends App { | |||
|
|||
class ServerActor extends actors.Actor { | |||
def act() { | |||
actors.remote.RemoteActor.alive(23456) | |||
actors.remote.RemoteActor.register('test, actors.Actor.self) | |||
loop { | |||
react { | |||
case TestMsg => println("Yay!") | |||
} | |||
} | |||
} | |||
} | |||
|
|||
val a = new ServerActor | |||
a.start() | |||
|
|||
} |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
package server | |||
|
|||
|
|||
|
|||
case object TestMsg |