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

how to reuse goja.Program? #535

Closed
wxyz520 opened this issue Sep 27, 2023 · 1 comment
Closed

how to reuse goja.Program? #535

wxyz520 opened this issue Sep 27, 2023 · 1 comment

Comments

@wxyz520
Copy link

wxyz520 commented Sep 27, 2023

I precompiled the JavaScript code into Map[string] *goja.Program, and each time I use it, I can directly retrieve it from the Map and execute RunProgram. I want to know goja.Program is goroutine-safe? , and how to reuse goja.Program

@dop251
Copy link
Owner

dop251 commented Sep 29, 2023

It is documented, but in a slightly wrong place I think: https://pkg.go.dev/github.com/dop251/goja#Compile
I'll probably move it to https://pkg.go.dev/github.com/dop251/goja#Program

@dop251 dop251 closed this as completed in acb9272 Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants