Hi Jakub,

On Fri, May 29, 2015 at 11:36 AM, Jakub Liska <[email protected]> wrote:

> Hey,
>
> I have a Source that merges ActorPublishers, this is a simplification :
>
> Source[Foo]() { implicit b =>
>         val actorSources = myActorPublisherArray
>         b.add(Merge[Foo](actorSources.length))
>         for (i <- 0 until actorSources.length) {
>           b.addEdge(b.add(actorSources(i)), merge.in(i))
>         }
>         merge.out
>       }
>     }
>
>
>
> class MyActorPublisher extends ActorPublisher[Foo] {
>   var batchIterator = someBlockingIterator
>
>
>   def pushNext: Boolean = {
>         if (batchIterator.hasNext) {
>
>       val nextMnfResource = batchIterator.next()
>       onNext(nextMnfResource)
>       true
>     } else {
>       onCompleteThenStop()
>       false
>     }
>   }
>   def receive: Receive = {
>     case Request(n) if totalDemand > 0 && isActive =>
>       (1L to Math.min(n, totalDemand)).foldLeft(true) {
>

What is the above line intending to do? Why are you taking a minimum of n
and totalDemand? Why are you not using totalDemand directly?


>
>         case (acc,i) => if (acc) pushNext else false
>       }
>     case Cancel =>
>       context.stop(self)
>   }
> }
>
>
>
> But the stream is idling most of the time with like 1% CPU usage like
> there was no `pull demand` for some reason... I'm trying to reproduce it
> and find the catch for 2 days already.
>
> Any idea why that could be? I think it started with RC1 or RC2 when I set
> Flow#mapAsync(parallelism) as required in following Flows, I removed all
> custom "Stages" and I don't really do anything except Map and MapAsync in
> flows...
>
> Also it doesn't seem to be happening with
>
>       .withInputBuffer (
>         initialSize = 1,
>         maxSize = 1
>       )
>
>
> But then the throughtput is insufficient...
>
> --
> >>>>>>>>>> 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.
>

-- 
>>>>>>>>>>      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