Thanks Patrik, but I am more interested in finding the path name of the
Future to return the message. For Instance,
// First Starting the actor system
ActorSystem system = ActorSystem.create("System1");
ActorRef master= system.actorOf(Master.createMaster(), "Master");
master.tell(initiateProcess, ActorRef.noSender());
// Following is the future call to an actor
Future<Object> future = Patterns.ask(master , new FinalResult(), 100000);
And the Master Actor messages are as following.
if(message instanceof initiateProcess){
worker.tell(( initiateProcess) message, getSelf());
}
else if(message instanceof ResultList){
//get the reply from the worker of the resulted computation
//send the result back to Future
} else if(message instanceof FinalResult){
/// To recieve and send message to the Future
}
So what I would like to achieve is to send the result back to the future if
the master receives the result message from its worker.
Cheers
Syd
On Tuesday, 25 November 2014 09:21:35 UTC+1, Patrik Nordwall wrote:
>
> Yes, you can use ask with ActorSelection.
> /Patrik
>
> On Mon, Nov 24, 2014 at 2:47 PM, Syd Gillani <[email protected]
> <javascript:>> wrote:
>
>> Yeah by Future request I mean ask pattern.
>>
>> Well the configuration of my actors is as following.
>>
>> - Create Actor System
>>
>> - Create Master and Send an Object for processing.
>>
>> - Create Future and ask the Result form the Master
>>
>>
>>
>> Master will create various workers and then aggregate the result from
>> them.
>>
>> This aggregated result will be send to the Future.
>>
>> So I would like to send the response back to Future when the aggregated
>> result is computed in the Master
>>
>>
>> Syd
>>
>>
>>
>>
>>
>>
>>
>>
>> On Monday, 24 November 2014 11:52:28 UTC+1, Martynas Mickevičius wrote:
>>>
>>> By "future request" you mean ask (?) pattern
>>> <http://doc.akka.io/docs/akka/2.3.7/scala/actors.html#Ask__Send-And-Receive-Future>,
>>>
>>> right?
>>>
>>> If so, why do you want to complete the future by other means than
>>> replying to the original message?
>>>
>>> On Mon, Nov 24, 2014 at 12:37 PM, Syd Gillani <[email protected]>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I was going through the Akka actorselection documents and as it
>>>> describes that you can select and actor and send a reply to it. For
>>>> instance
>>>>
>>>> getContext().system().actorSelection("/actor/a").tell(result,
>>>> getContext().self());
>>>>
>>>> However, I was wondering if its possible in case of future as well.
>>>> Does the system provide any name or path id's to the future request as
>>>> well. Because according to my experiments, the future are assigned as a
>>>> temporary actors with paths as ''/temp/$a''. But if I use such path from
>>>> an actor to reply back a future It just simple doesn't work.
>>>>
>>>> My project have a master actor and various worker actors and I used
>>>> future to get the aggregated result form the master.
>>>>
>>>> Thanks in advance.
>>>>
>>>> Syd
>>>>
>>>>
>>>>
>>>> --
>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
>>>> current/additional/faq.html
>>>> >>>>>>>>>> Search the archives: https://groups.google.com/
>>>> group/akka-user
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Akka User List" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Martynas Mickevičius
>>> Typesafe <http://typesafe.com/> – Reactive
>>> <http://www.reactivemanifesto.org/> Apps on the JVM
>>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> - Reactive apps on the JVM
> Twitter: @patriknw
>
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.