Isn't your comment about "messes up the pseudo-single-threading invariant
of Actors" more about not closing over mutable state? In any case, you
can't avoid Futures if you're using Slick or HTTP clients, for example.

On Fri, Oct 21, 2016 at 7:32 AM, Richard Rodseth <rrods...@gmail.com> wrote:

> I've had no problems using Futures within actors and piping the result to
> the actor, after mapping. I have had problems when an actor gets flooded
> and you get timeouts because you're simply starting up too many Futures.
> That, I think, is where back-pressure changes the landscape.
> Thanks for the Requester link.
>
> On Fri, Oct 21, 2016 at 4:55 AM, Justin du coeur <jduco...@gmail.com>
> wrote:
>
>> On Thu, Oct 20, 2016 at 5:55 PM, Richard Rodseth <rrods...@gmail.com>
>> wrote:
>>
>>> Short version: is it fair to say the traditional warnings against ask()
>>> hold less weight because we have back-pressure?
>>>
>>
>> Well, keep in mind that at least some of the usual warnings against ask()
>> have nothing obviously to do with that sort of thing.  The biggest
>> traditional problem with ask() is really a warning about using Future --
>> it's always dangerous to map/flatMap on a Future inside of an Actor,
>> because the Future will generally execute in parallel rather than properly
>> synchronized in receive; as a result, Future messes up the
>> pseudo-single-threading invariant of Actors.  And since a for comprehension
>> of ask() is simply mapping over Futures, it's automatically a bit risky.  I
>> don't see how back-pressure helps with that.
>>
>> I haven't thought about how it interacts with streams, but fixing the
>> ask() problem is the whole point of the Requester library
>> <https://github.com/jducoeur/Requester>. You might want to give that a
>> look, and see if it helps with your needs...
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/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