Removed redundant thread code
This commit is contained in:
parent
14eaf423f0
commit
260aa0fdc4
16
ActorDemo.sc
16
ActorDemo.sc
@ -77,17 +77,13 @@ object RootActor {
|
|||||||
|
|
||||||
@main
|
@main
|
||||||
def main() = {
|
def main() = {
|
||||||
val t = new Thread(() => {
|
implicit val rootActor =
|
||||||
implicit val rootActor =
|
ActorSystem(RootActor(), "TestActors")
|
||||||
ActorSystem(RootActor(), "TestActors")
|
|
||||||
|
|
||||||
implicit val timeout: Timeout = 3.seconds
|
implicit val timeout: Timeout = 3.seconds
|
||||||
|
|
||||||
|
rootActor ! RootActor.Begin
|
||||||
|
rootActor ! RootActor.GetResult
|
||||||
|
|
||||||
rootActor ! RootActor.Begin
|
|
||||||
rootActor ! RootActor.GetResult
|
|
||||||
})
|
|
||||||
t.setDaemon(true)
|
|
||||||
t.start()
|
|
||||||
Thread.sleep(1000)
|
Thread.sleep(1000)
|
||||||
System.exit(0)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user