Thanks Endre and Roland! Yes, when I add a buffer just before zip.in0, both tests pass:
unzip.out0.buffer(10, OverflowStrategy.backpressure) ~> zip.in0 So, adding the buffer is enabling the parallelism. However, why does not the first test (the one without zip/unzip) need a buffer to enable parallelism (e.g., just before merge)? Thanks, Anil On Wed, Dec 21, 2016 at 2:40 AM, Endre Varga <endre.va...@lightbend.com> wrote: > Yes, that might be the case. > > On Wed, Dec 21, 2016 at 9:39 AM, Roland Kuhn <goo...@rkuhn.info> wrote: > >> I think what is happening here is that zip does not pull until the >> delayed element has come out, meaning that the second (less delayed) >> element will not overtake it. mapAsync is effectively a buffer, so you'll >> need a buffer in front of zip.in0 as well to enable parallelism. >> >> Regards, Roland >> >> Sent from my iPhone >> >> On 21 Dec 2016, at 09:34, Endre Varga <endre.va...@lightbend.com> wrote: >> >> >> >> On Tue, Dec 20, 2016 at 11:34 PM, Anil Gursel <anilgur...@gmail.com> >> wrote: >> >>> I see that unzip does not pull the next element when fusing is on. I >>> understand that when fusing is on, a message goes through the entire stream >>> and then the next message goes through. >>> >> >> This is not true, messages are handled concurrently even in fused >> islands, it is just that they are not parallel. I.e. same thread, but event >> order is unspecified. In fact, fused islands are fair in that even in the >> case of long-running cycles other parts of the graph can still progress >> (which would not be true if what you said would be true) >> >> >>> However, is it still the case when `mapAsyncUnordered` is used? >>> >> >> mapAsync wait on asynchronous events, so that needs to wait until those >> are ready. In the meantime the rest of the graph can progress. >> >> >>> >>> Please see the two tests at https://gist.github.com/ani >>> lgursel/aa70497a9431fc8b498c599d9d469e2b. The two tests are identical >>> except the second one does an unzip then a zip. The first one succeeds and >>> the second one fails. The first one succeeding means that when >>> `mapAsyncUnordered` is used, it is not actually waiting for the previous >>> message to go through the entire stream. >>> >> >> Again, there is no "previous message go through the entire stream". That >> would lead to starving scenarios that you describe. What fusing changes is >> that it removes buffers and hence prefetches. Try out higher delays and see >> what happens. >> >> -Endre >> >> >> >>> >>> I will appreciate if you can shed some light on what's going on in this >>> samples. >>> >>> Thanks, >>> Anil >>> >>> -- >>> >>>>>>>>>> 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/grou >>> p/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/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/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. > -- >>>>>>>>>> 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.