Re: [play-framework] Re: [play 2.1-RC1-iteratee] Concurrent.unicast prevents process from terminating

131 views
Skip to first unread message

James Roper

unread,
Jan 5, 2013, 5:53:11 PM1/5/13
to play-framework
There's nothing wrong with your code, everything's working as expected.  The reason it's not shutting down is that Play's iteratee has a non daemon thread pool.  Usually this doesn't cause a problem, since when you run Play or its tests, System.exit() is invoked when it shuts down.  But running code outside of a Play framework context like this will cause a problem.

We need to address this in Play, but I'm not sure what the right solution is.


On Fri, Jan 4, 2013 at 8:57 AM, Josh Gao <jmg...@gmail.com> wrote:
Post-holiday bump


On Saturday, December 22, 2012 12:49:40 AM UTC-8, Josh Gao wrote:
I'm playing around with the 2.1-RC1 iteratee library with scala 2.10.0-RC5, and am running into an an annoyance. It seems like using Concurrent.unicast prevents the termination of the JVM. I've thrown up a pretty minimal test case at https://gist.github.com/4358042. This prints out "foo\nbar\nResult: foo bar" as expected, and just hangs until the JVM is killed. Replacing the instantiation of enumerator with Enumerator("foo", "bar") terminates immediately, and removing everything but the construction of the enumerator still hangs. Is this supposed to happen?

Also, is this even the correct way to use Concurrent.unicast? The actual thing I want to use enumerators/iteratees for is a wrapper around a Java library that uses an iterator to provide data that's being streamed across the network slowly. I originally started with Enumerator.pushee, but that's tagged as deprecated (and was blowing up with a NPE when used in an identical fashion).

Thanks,
Josh

--
 
 



--
James Roper
Software Engineer

Typesafe - The software stack for applications that scale
Twitter: @jroper

Pablo Guerrero

unread,
Jan 28, 2013, 8:15:48 AM1/28/13
to play-fr...@googlegroups.com
Hi James,

Is there any issue tracking this problem? Do you know a work around to explicitly shutdown the thread pool (without doing System.exit() directly)?

Thanks in advance,
Pablo

Mathias Bogaert

unread,
Mar 14, 2013, 6:41:04 AM3/14/13
to play-fr...@googlegroups.com
I'm facing the same issue. At the moment it seems impossible to shutdown the thread pool.

Carlos Feliz

unread,
Oct 13, 2013, 10:20:06 PM10/13/13
to play-fr...@googlegroups.com
Has this been resolved in 2.2? I'm having this problem using play 2.2 Iteratees outside of play and can't seem to figure out how to shutdown without system.exit().
Reply all
Reply to author
Forward
0 new messages