No, "ask" shouldn't have this problem.  Each ask() operation creates a
little pseudo-Actor under the hood, which is unique for this operation,
which will be the receiver of the response.  So long as the Actor is
responding to sender(), the response should go to the ask() that initiated
this message; cross-talk shouldn't be possible.  (This is actually a very
common situation.)

On Sat, Jan 27, 2018 at 5:56 PM, Joseph Mansigian <
joseph.c.mansig...@gmail.com> wrote:

> Hello All,
>
> I am making a Scala/Akka Actor based application.
>
> It is necessary for me to query an actor from a controller.
> The queried actor is always the same; only one of these exist.
>
> From the controller I am using the "ask' pattern to send a query message
> to the actor.
> The query message contains a unique key that the actor uses to lookup
> information which it
> formats into a response message and sends the message back to the
> controller.
>
> I have coded this and it seems to work fine; used it extensively.
>
> Here is my concern:
>
> Many clients can be making queries at once.  Let's say that there are two
> queries overlapping in time.
> One of the queries contains the key "abc".  The other query contain the
> key "xyz".
> Since this is async. can a race condition occur that responds to the "abc"
> keyed query with
> the "xyz" keyed data because "xyz" arrives first.  Maybe I am worrying
> about nothing.  Is this managed automatically under the hood?
>
> Thanks, Joe
>
> --
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to