And of course "Thread.sleep()" is evil™ also always applies.

On Mon, Jan 11, 2016 at 11:47 AM, Bruno Bieth <[email protected]> wrote:

> Thanks,
>
> @drewhk <https://github.com/drewhk> told me this as well and it works! I
> forgot that akka-stream 2.0 introduced fusing...
>
> Regards,
> Bruno
>
>
> On Monday, January 11, 2016 at 10:36:28 AM UTC+1, rkuhn wrote:
>>
>> Hi Bruno,
>>
>> it works with fuzzing because the interpreter will only process one step
>> before looking into its Actor mailbox—but what actually breaks things is
>> your usage of Thread.sleep. If you want to block, you’ll typically want to
>> do so behind an Attributes.asyncBoundary.
>>
>> Regards,
>>
>> Roland
>>
>> 11 jan 2016 kl. 10:26 skrev Bruno Bieth <[email protected]>:
>>
>> Turns out it works with fuzzing (explaining why it passes the test suite).
>> I've submitted an issue: https://github.com/akka/akka/issues/19394
>>
>> On Monday, January 11, 2016 at 8:45:19 AM UTC+1, Bruno Bieth wrote:
>>>
>>> I can't tell if I'm doing something wrong in this code:
>>>
>>> implicit val as = ActorSystem()
>>> implicit val mat = ActorMaterializer()
>>>
>>> val future = Source.fromIterator(() => new Iterator[Int] {
>>>   var i = 0
>>>   override def hasNext: Boolean = true
>>>   override def next(): Int = {
>>>     println(s"Waiting $i seconds")
>>>
>>>     scala.concurrent.blocking {
>>>
>>> Thread.sleep(i * 1000)
>>>
>>>     }
>>>     i = i + 1
>>>     i
>>>   }
>>> }).groupedWithin(20, 2.seconds).runForeach(println)
>>>
>>> Await.ready(future, 10.seconds)
>>>
>>>
>>> It seems to me that at least something should be printed. But the output
>>> invariably is:
>>>
>>> Waiting 0 seconds
>>> Waiting 1 seconds
>>> Waiting 2 seconds
>>> Waiting 3 seconds
>>> Waiting 4 seconds
>>> Waiting 5 seconds
>>>
>>> java.util.concurrent.TimeoutException: Futures timed out after [10000
>>> milliseconds]
>>>
>>> I tried to follow the code of GroupedWithin and it seems that the timer
>>> works as expected but then when the AsyncCall gets called nothing happens
>>> (from `GraphStage`):
>>>
>>> interpreter.onAsyncInput(GraphStageLogic.this, event, 
>>> handler.asInstanceOf[Any ⇒ Unit])
>>>
>>>
>>> Bruno
>>>
>>
>> --
>> >>>>>>>>>> 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.
>>
>>
>>
>>
>> *Dr. Roland Kuhn*
>> *Akka Tech Lead*
>> Typesafe <http://typesafe.com/> – Reactive apps on the JVM.
>> twitter: @rolandkuhn
>> <http://twitter.com/#!/rolandkuhn>
>>
>> --
> >>>>>>>>>> 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.
>



-- 
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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to