« Return to Thread: future hangs

Re: future hangs

by Ricky Clarkson :: Rate this Message:

Reply to Author | View in Thread

Yet again, "let's remove Application".

2009/7/8 Detering Dirk <Dirk.Detering@...>:

> Nice subject ...
>
>> This simple application hangs at "println(s())". Apparently,
>> the mistake is so simple that I cannot find it... what am I
>> doing wrong? Defining getData and printing s() in the
>> interactive scala shell works just fine. Thanks!
>>
>> object Test extends Application {
>>
>>     val s = future(getData("AAPL\n"))
>>     val t = getData("INTC\n")
>>     println(t) // that's fine
>>     println(s()) // hangs here
>
> Well, the println(s()) will first wait for the result of s,
> but -due to the definition of s- that doesn't come now, but
> in future.
>
> Due to the functional aspect, this is true for every point in time.
>
> (I would recommend renaming the val s into val godot,
> and then putting the println(godot()) into a method called
> "mañana"...).
>
>
> Ðet
>
>
> PS: No, I'm NOT stressed, Mum!!!!
>



--
Ricky Clarkson
Java Programmer, AD Holdings
+44 1565 770804
Skype: ricky_clarkson
Google Talk: ricky.clarkson@...

 « Return to Thread: future hangs