The general rule is best effort, in this case we can do better :)

On Mon, Jul 27, 2015 at 4:07 PM, Endre Varga <[email protected]>
wrote:

>
>
> On Tue, Jul 21, 2015 at 11:52 AM, Viktor Klang <[email protected]>
> wrote:
>
>> I think your guess is correct. And It is a bit surprising, yes, since
>> Concat should at least subscribe to the second source (empty)  once the
>> first ("welcome") completes, which should trigger an onSubscriber +
>> onComplete.
>>
>
> I think this is not related to that, it subscribes to the second source.
> The state machine needs to be changed probably, I have to check.
>
> OTOH there are certain stages that do not send a completion until a new
> request comes in. This is actually also correct behavior, but not optimal,
> therefore we try to avoid it (it unnecessarily delays completion). In tests
> it is not recommended to rely on exact input dependent request counts, an
> onComplete might require an extra demand round.
>
> -Endre
>
>
>>
>> On Tue, Jul 21, 2015 at 11:34 AM, Jan Vincent Liwanag <
>> [email protected]> wrote:
>>
>>> Hi guys,
>>>
>>> Given the following flow --
>>>
>>> val flow = Flow() { implicit b =>
>>>
>>>   import FlowGraph.Implicits._
>>>
>>>
>>>   val welcome = Source.single("welcome")
>>>
>>>   val echo = b.add(Flow[String])
>>>
>>>
>>>   val concat = b.add(Concat[String]())
>>>
>>>
>>>   welcome ~> concat.in(0)
>>>
>>>   echo.outlet ~> concat.in(1)
>>>
>>>
>>>   (echo.inlet, concat.out)
>>>
>>> }
>>>
>>>
>>>
>>> Is this expected *not* to work?
>>>
>>> Source.empty
>>>
>>>   .via(flow)
>>>
>>>   .runWith(TestSink.probe())
>>>
>>>   .request(1)
>>>
>>>   .expectNext("welcome")
>>>   .expectComplete()
>>>
>>>
>>>
>>> However, changing the request size to '2' works ok:
>>>
>>>
>>> Source.empty
>>>
>>>   .via(flow)
>>>
>>>   .runWith(TestSink.probe())
>>>
>>>   .request(2)
>>>
>>>   .expectNext("welcome")
>>>   .expectComplete()
>>>
>>>
>>> I'm guessing this is since concat doesn't eagerly pull the next element
>>> from the second stream on the concat?
>>>
>>> --
>>> >>>>>>>>>> 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.
>>>
>>
>>
>>
>> --
>> Cheers,
>> √
>>
>> --
>> >>>>>>>>>> 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.
>



-- 
Cheers,
√

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