« Return to Thread: future hangs

Re: future hangs

by Mark Harrah :: Rate this Message:

Reply to Author | View in Thread

Don't use Application.  Just use a normal main method.  See
http://scala-blogs.org/2008/07/application-trait-considered-harmful.html

-Mark

On Tuesday 07 July 2009, turicum wrote:

> object Test extends Application {
>
>     val s = future(getData("AAPL\n"))
>     val t = getData("INTC\n")
>     println(t) // that's fine
>     println(s()) // hangs here
>                                                                            
>                   def getData(query: String): String = {
>          query
>      }
> }


 « Return to Thread: future hangs