Hi Anders,

On Wed, Feb 4, 2015 at 2:23 PM, Anders Båtstrand <[email protected]> wrote:

> Dear users
>
> I find the semantics of "defer" confusing.
>
> I thought defer was the same as persist, except the given message was not
> persisted. Now today, when a bug got me to read the doc again, it states
> that defer has the same semantics as persistAsync.
>
> My first thought was that "defer" should be renamed "deferAsync", to
> communicate the relation to persistAsync. Both are async, but the point is
> that persist is executed before the next command is processed, while
> persistAsync is not.
>

That might be a good point. Please create an issue
<https://github.com/akka/akka/issues>.


>
> Names aside, is there a function similar to defer, that is guaranteed to
> be executed before the next command is processed?
>

Isn't that the same thing as performing the thing immediately when the
command is received?

I would find it interesting to understand what you are trying to do and why.

As I see it, there are two approaches.

1) Use `persist`, then all incoming commands are stashed until the
outstanding `persist` tasks are completed.

2) Use `persistAsync` and `defer` for *all* incoming commands that have an
ordering dependency to outstanding `persistAsync` and other `defer` tasks.
Other commands that don't have this ordering requirement can be processed
immediately.

Regards,
Patrik


>
> Best regrads,
>
> Anders Båtstrand
>
> --
> >>>>>>>>>> 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.
>



-- 

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.

Reply via email to