scala - Actors make my computer hang -
the following code makes computer hang time:
object application extends app { val system = actorsystem() val supervisor = system.actorof(props[supervisor]) implicit val timeout = timeout(10 seconds) import system.dispatcher val future = supervisor ? supervisor.start val idlist = await.result(future, timeout.duration).asinstanceof[list[myclass]] supervisor ! idlist } it causes exception of timeout later when barely responds. previously, when code didn't use actors, worked fine.
i can't post of because there lot of it. code have post?
update:
how find out problem is?
looks not terminating actorsystem , hence application not terminate. @ end need call system.shutdown shutdown actorsystem.
internally actorsystem manages threads needs terminated application terminate. shutdown terminates them. not calling prevent application shutting down threads still alive.
Comments
Post a Comment