>
> It means though that if you start 2 streams using a part of that mapConcat
> would end up accessing the same iterator potentially concurrently.
The functor uses the elements from the flow to create the iterators, so
there's no reason it has to return the same objects in multiple
materialized streams?
Was the rationale that the functor could return the same Iterable objects
into multiple streams, as long as the Iterables supported thread-safe
iteration?
On Tuesday, September 26, 2017 at 10:36:08 PM UTC-7, Konrad Malawski wrote:
>
>
> Are multiple iterators ever needed to be requested from it?
>
> I'm kind of tempted to do
> Flow.<Iterator<T>>create().mapConcat(iter -> new Iterable<T>() {
> @Override
> public Iterator<T> iterator()
> {
> return iter;
> }}).grouped(chunkSize).map(list -> list.iterator())
>
>
> That’s what “multiple materializations of the same stream pipeline” are,
> so yes.
>
> If returning the same iterator is what you want there then feel free to do
> so; It means though that if you start 2 streams using a part of that
> mapConcat would end up accessing the same iterator potentially concurrently.
>
> — Konrad
>
--
>>>>>>>>>> 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.