Skip to content

Lambda functions take few seconds at runtime to execute #1

Description

@johnmeshulam

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginvestigateRequires additional research

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions