Sunday 15 July 2012

akka - Scala actor call an actor trouble -


I will start working with Akka actors do, and code writing, I do work, but really I how to look forward:

  Import com.mongodb.casbah.Imports import com.mongodb.casbah.Imports._ import org.bson.types.ObjectId import org.joda.time.DateTime Import org.joda.time.DateTimeZone.UTC import Com.mongodb.casbah.commons.conversions.scala._ import akka.actor.Actor import akka.actor.ActorSystem import akka.actor.Prop object command {case class GetActivities (UID : String) Case class GetIds (activities: Iterable [ DBObject]) Case square GetDataForIds (data: map [string list [object]]) class commands received extended Actor {DRF = {case commands. Gate activites (uid) = & gt; Sender ! Commands. Gate Activitity (UID) Case Commands Gateways (activities) = & gt; Sender ! order. Gateways (Activities) Case Command GetDataFor IDS (Data) = & gt; Sender ! order. GateDataForIdS (data)}} class actions enhances the actor {Override DEF prestart (): unit = {val command = context. Actor (props [command], "commands") command! Get orders. ( "53f76b6553544244db060000"}} Diif Get = {case commands. GetActivities (uid) = & gt; {Println (get (uid)) println ( "Activities Get") println ( "--------- --- ") from! order get (UID))}} Diif (User ID: string): Iterebl [Dibiobijed] = {}} class eds () enhances the actor is {DRF = {case commands. Gateways (activities) = & gt; {Println (getIds (activities)) println ("get ids") println ("------------") sender! Command. Getdataforaidis (GetIds (activities))}} def Aiaiaidiads (activities: Iterebl [Dibiobijed]): map [string list [object]] =} class Detaforaidis () actress {extension receive {DRF ======= ======================== = & gt; (String, list [object]]: Map [String, Any] = {} object driver {Diif main {Well System = Actor Systems ( "Men") Well AAC = SystemkactorOf (Props [Activities]}}   

when I compile my driver runs. I - I get only

  println (get (uid)) Println ( "get" Activities) The println ("------------")  

and the process without CRRL + C looks like freeze

but I < Code> activities in I wanted to get into the case command. After walking function after running function get (uid) start actor id - did I do wrong that my concept IdsgetIds (Kriyaklapkjet (UID))

Giant @ Sarvesh-Kumar thanks for -sinh, and the answer

  class commander extended the actor {DRF received = {case commands. gate Aktivetiti (UID) = & gt; from! commands. get a Tivetiti (UID) case commands. Gateways (activities) = & gt; Val ID = context. Factors (Props [ID], "ID") ID! order. Gateways (Activities) Case Command GetDataFor IDS (Data) = & gt; Val dataforces = references Factors (props [datophorids], "deraaforid") Dataforides! order. Gate datafor id (data)}}  

No comments:

Post a Comment