blob: 1e218351afde368b4401417e303959c073e6aad0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
package examples;
import concurrent.ops._;
module futures {
def someLengthyComputation = 1;
def anotherLengthyComputation = 2;
def f(x: Int) = x + x;
def g(x: Int) = x * x;
val x = future(someLengthyComputation);
anotherLengthyComputation;
val y = f(x()) + g(x());
System.out.println(y);
}
|