When passed as a parameter for Wait.waitFor() or Parallel.doAction(), lambda functions will block for a good few seconds at runtime:
System.out.println("Before");
Parallel.doAction( () -> {
System.out.println("While");
});
System.out.println("After");
The delay betweek "Before" and "While" is a few seconds long.
Writing the implementation of the Functional Interface fixes this issue:
System.out.println("Before");
Action a = new Action() {
@Override
public void execute() {
System.out.println("While");
}
};
Parallel.doAction(a);
System.out.println("After");
The delay between "Before" and "While" is unnoticeable.
When passed as a parameter for
Wait.waitFor()orParallel.doAction(), lambda functions will block for a good few seconds at runtime:The delay betweek "Before" and "While" is a few seconds long.
Writing the implementation of the Functional Interface fixes this issue:
The delay between "Before" and "While" is unnoticeable.