In general relying on exact timing of pulls is rather seen as an anti
pattern…
Even if you do a custom stage, it’s very brittle, as any element put before
your stage could cause pulls, simply because that’s how things work.
The same can be said about simply changed buffer sizes between stages —
introducing an async boundary anywhere in the pipeline can lead
to more buffer space being allocated, and thus, more pulls being issued.

In other words — due to the fact that backpressure is connected through an
entire pipeline (and has to, otherwise it would not do what it should),
you can not rely on exact timing of pulls, because changes in the pipeline
may affect this.

In your very specific case perhaps it’s doable to make a stage or pipeline
that’ll do the right thing, with enforcing it with zips and loops,
but that’ll be specific and take some work and very precise wording of what
you want to achieve (sample code?)

-- 
Cheers,
Konrad 'ktoso <http://kto.so>' Malawski
Akka <http://akka.io/> @ Lightbend <http://lightbend.com/>

On February 23, 2018 at 7:05:18, Jeff ([email protected]) wrote:

Currently, Flow.mapAsync and Flow.mapAsyncUnordered always pull upstream
even if there is no demand from downstream and then buffer. However, there
are situations where one might want to way for explicit downstream demand
before pulling. For example, let's say that the next upstream item depends
on the results of the previous item and that you need to feed that back
into the upstream before pulling again. In its current form, Flow.mapAsync
will pull before that feedback loop has been completed.

Is there any way to work around that other than writing a custom
GraphStage?

Thanks
Jeff
--
>>>>>>>>>> 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 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 [email protected].
To post to this group, send email to [email protected].
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