Sorry for not understanding yet. The message ordering link cited earlier 
seems to me to be suggesting that ultimately programs in general can only 
have reliable message passing by having business logic that deals with it. 
The section from that link says:

*for a given pair of actors, messages sent directly from the first to the 
> second will not be received out-of-order. *The word *directly* emphasizes 
> that this guarantee only applies when sending with the tell operator to 
> the final destination, not when employing mediators or other message 
> dissemination features (unless stated otherwise).

 
I thought that this is no actor passing a message to an actor:

        final ActorRef greeter = 
> system.actorOf(Props.create(Greeter.class), "greeter");
>         greeter.tell(new WhoToGreet("akka"), ActorRef.noSender());


And this is the Inbox actor sending a message to an actor:

        inbox.send(greeter, new Greet());


So, I thought that would mean that it is not the scenario described where 
there is 1 pair of actors passing messages between each other. It's 2 
independent pairs, I thought. greet.tell is one pair? no actor and an 
actor. inbox.send is another pair: inbox actor exchanges a message with the 
greeter actor. If that is the case, then is the order undefined between the 
2 invocations?

Tal Pressman, earlier in the thread, says the message are sent from the 
same "context". Maybe I'm missing a context other than the pair of actors 
that applies to message ordering.

Kendall

On Wednesday, September 7, 2016 at 5:12:49 AM UTC-7, Patrik Nordwall wrote:
>
> I think the line that might cause confusion here is
>
> inbox.send(greeter, new Greet());
>
> The inbox can be seen as a "mediator" and therefore perceived as it might 
> not preserve ordering. For this reason I would prefer to write it as:
>
> greeter.tell(new Greet(), inbox.getRef());
>
> That is exactly how inbox.send is implemented, so the ordering is just 
> fine.
>
> Cheers,
> Patrik
>
> On Wed, Sep 7, 2016 at 10:58 AM, Guido Medina <oxy...@gmail.com 
> <javascript:>> wrote:
>
>> In the introduction chapter of Akka this is explained in details, how 
>> Akka takes care of it,
>> I suggest you go there to learn the exact details:
>>
>>
>> http://doc.akka.io/docs/akka/2.4.10/general/message-delivery-reliability.html#Discussion__Message_Ordering
>>
>> HTH,
>>
>> Guido.
>>
>>
>>
>> On Tuesday, September 6, 2016 at 5:12:32 PM UTC+1, que...@gmail.com 
>> wrote:
>>>
>>> The order that they are received would be the critical thing, I would 
>>> think. So, is the example not dealing with the possibility that the 
>>> messages could be received out of order? Or, is this somehow taken care of?
>>>
>>> Kendall
>>>
>>> On Monday, September 5, 2016 at 2:40:34 AM UTC-7, Tal Pressman wrote:
>>>>
>>>> Hi,
>>>>
>>>> Message ordering is preserved between a sender-receiver pair. However, 
>>>> this refers to the actual actual actor sending the message, regardless of 
>>>> the ActorRef passed as the sender reference.
>>>> In the example above, both messages are being sent from the same 
>>>> context, and therefor should be sent in-order.
>>>>
>>>> Tal
>>>>
>>>>
>>>> On Saturday, September 3, 2016 at 8:19:33 AM UTC+3, que...@gmail.com 
>>>> wrote:
>>>>>
>>>>> I'm early in learning Akka. The hello-akka-java8 tutorial has 
>>>>> greeter.tell from no actor, followed by inbox.send:
>>>>>
>>>>> final ActorRef greeter = system.actorOf(Props.create(Greeter.class), 
>>>>> "greeter");
>>>>> final Inbox inbox = Inbox.create(system);
>>>>> greeter.tell(new WhoToGreet("akka"), ActorRef.noSender());
>>>>> inbox.send(greeter, new Greet());
>>>>> Greeting greeting1 = (Greeting) inbox.receive(Duration.create(5, 
>>>>> TimeUnit.SECONDS));
>>>>>
>>>>> Can I expect that the greeter actor is going to process new 
>>>>> WhoToGreet("akka"), before new Greet()?
>>>>>
>>>>> If so, why?
>>>>>
>>>>> I read in Akka documentation:
>>>>>
>>>>> "*...for a given pair of actors, messages sent directly from the 
>>>>> first to the second will not be received out-of-order.* The word 
>>>>> *directly* emphasizes that this guarantee only applies when sending 
>>>>> with the telloperator to the final destination, not when employing 
>>>>> mediators or other message dissemination features (unless stated 
>>>>> otherwise)."
>>>>>
>>>>> I think the tutorial is not sending messages from one actor.
>>>>>
>>>>>
>>>>> -- 
>> >>>>>>>>>> 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+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Akka Tech Lead
> Lightbend <http://www.lightbend.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 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