Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda functions take few seconds at runtime to execute #1

Open
johnmeshulam opened this issue Nov 10, 2019 · 0 comments
Open

Lambda functions take few seconds at runtime to execute #1

johnmeshulam opened this issue Nov 10, 2019 · 0 comments
Assignees
Labels
bug Something isn't working investigate Requires additional research

Comments

@johnmeshulam
Copy link
Contributor

johnmeshulam commented Nov 10, 2019

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.

@johnmeshulam johnmeshulam added bug Something isn't working investigate Requires additional research labels Nov 10, 2019
@johnmeshulam johnmeshulam self-assigned this Nov 10, 2019
@johnmeshulam johnmeshulam pinned this issue Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigate Requires additional research
Projects
None yet
Development

No branches or pull requests

1 participant