eclipsesource / eclipsesource/J2V8

NodeJS.exec(...) overload with callback

Open
#304 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.6k
Forks
387
PR merge metrics
No merged PRs in 30d

Description

Hi,
as the code comment of the existing [NodeJS.exec()](https://github.com/eclipsesource/J2V8/blob/master/src/main/java/com/eclipsesource/v8/NodeJS.java#L183) tells, there is currently no way to exec a script via the NodeJS API and wait until the script was actually executed in the V8 engine.

I propose to extend the API with two additional overload for the exec(...) method:
1) a blocking variant, that will step the NodeJS message queue internally and return when the script has been executed
2) a callback variant, that will execute a provided callback once the script has been executed

I'll work on a PR if there is agreement that this is a sensible addition.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.