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

Implement javax.script.Invocable #60

Open
kent-rosenkoetter-vgs-io opened this issue Mar 3, 2021 · 2 comments
Open

Implement javax.script.Invocable #60

kent-rosenkoetter-vgs-io opened this issue Mar 3, 2021 · 2 comments
Labels
enhancement Enhance functionality in Starlarky

Comments

@kent-rosenkoetter-vgs-io

The Java scripting API has an interface for scripting engines that allow directly calling a function or method inside of the script. This is the ideal way to execute the process function defined as the VGS script entry point.

@mjallday
Copy link
Contributor

mjallday commented Mar 3, 2021

Can you give an example of how this would be used?

@Agitolyev
Copy link
Contributor

It will be used like JS invocations are:

val  result = invocable.invokeMethod(input, context, params);

Instead, how API looks now:

val result = (ParsedStarFile) instance.eval();
var output = result.getGlobalEnvironmentVariable(outputVar, Object.class);

@mahmoudimus mahmoudimus added the enhancement Enhance functionality in Starlarky label Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance functionality in Starlarky
Projects
None yet
Development

No branches or pull requests

4 participants