Open ceefour opened 10 years ago
The error happens for remote nodes. The local node can execute the closure.
Please take a look at Java8 examples under "examples/java8". Here is a sample code from there:
grid.compute().run((GridRunnable)() -> System.out.println("Hello World")).get()
Thanks, this works:
grid.forRemotes().compute().run((GridRunnable) () -> System.out.println("Hello") ).get();
Is there any reason why (GridRunnable)
cast is mandatory?
The strange thing is new Runnable() { ... }
works, while plain lambda doesn't, even if the lambda returns a Runnable
.
IMHO if GridGain doesn't handle a specific Runnable
implementation like given by Java8 lambda, the error message needs to mention this fact and provide assistance error message: "Please cast your job to GridRunnable"
Agree on the message, will fix.
Code:
GridGain 6.1.9.
Test project: https://github.com/ceefour/gggettingstarted
Error: