Revision c67ea430

View differences:

bundles/org.simantics.scl.runtime/scl/Async.scl
1 1
importJava "org.simantics.scl.runtime.utils.AsyncUtils" where
2
    runAsync :: (<Proc> a) -> <Proc> ()
2
    runAsync :: (<Proc> a) -> <Proc> ()
3
    pmap :: (a -> b) -> [a] -> [b]
bundles/org.simantics.scl.runtime/src/org/simantics/scl/runtime/utils/AsyncUtils.java
2 2

  
3 3
import java.io.PrintWriter;
4 4
import java.io.StringWriter;
5
import java.util.Arrays;
6
import java.util.List;
5 7

  
6 8
import org.simantics.scl.runtime.SCLContext;
7 9
import org.simantics.scl.runtime.function.Function;
......
27 29
            }
28 30
        }.start();
29 31
    }
32
    
33
    public static List<Object> pmap(Function f, List<Object> l) {
34
        return Arrays.asList(l.parallelStream().map(a -> f.apply(a)).toArray());
35
    }
30 36
}

Also available in: Unified diff