Hi Anton,

My Play knowledge is a little bit hazy here, but the first nesting level
closes over "Akka.system.scheduler" inside the "schedule" callback and I
think that causes the problem with Play reloads. Just a guess.

But anyhow, this kind of nesting looks very fishy. I would rather do an
Actor instead that just handles more complex scenarios. For example it can
schedule a self-message (without closing over anything scary) every 3rd
second, possibly ignoring ticks when not needed, and cancelling after n
times.

-Endre


On Thu, Jun 19, 2014 at 9:37 AM, Anton Fagerberg <[email protected]>
wrote:

> I'm using Akka with Play Framework and recently updated to Play Framework
> 2.3 (which uses Akka 2.3.3).
>
> In my code I have a piece which nestles Akka schedulers, something like
> this:
>
> Akka.system.scheduler.schedule(0 seconds, 20 seconds) {
>
>   Akka.system.scheduler.scheduleOnce(3 seconds) {
>     println("stuff")
>   }}
>
> But since upgrading Play and Akka, the reload doesn't work and the reason for 
> this seems to be that Akka is unable to shut down. The simple code above is 
> enough to reproduce the problem inside Play Framework. What makes this 
> problem harder is that there is no error what so ever. It simply hangs with 
> the following message:
>
>
> [success] Compiled in 993ms
>
> --- (RELOAD) ---
> [info] play - Shutdown application default Akka system.
>
> And then nothing happens at all.
>
> I have filed a bug with Play Framework 
> (https://github.com/playframework/playframework/issues/3048) but the first 
> answer seems to think that this is related to Akka rather than Play. However, 
> I've tried using the code inside the simple "hello-akka" inside Activator and 
> then it worked fine so it may have to do something with the way Play reloads 
> Akka.
>
> So of course I can work around this problem and avoid using nestling - but it 
> is probably something that has to be fixed either way.
>
> Any suggestions?
>
>  --
> >>>>>>>>>> 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.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

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