Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func main() {
// Precompile the script to bytecode
byteCode := must(ctx.Compile("script.js", qjs.Code(script), qjs.TypeModule()))
// Use a pool of runtimes for concurrent requests
pool := qjs.NewPool(3, &qjs.Option{}, func(r *qjs.Runtime) error {
pool := qjs.NewPool(3, qjs.Option{}, func(r *qjs.Runtime) error {
results := must(r.Context().Eval("script.js", qjs.Bytecode(byteCode), qjs.TypeModule()))
// Store the exported functions in the global object for easy access
r.Context().Global().SetPropertyStr("handlers", results)
Expand Down Expand Up @@ -591,7 +591,7 @@ func main() {
return nil
}
// Create a pool with 3 runtimes
pool := qjs.NewPool(3, &qjs.Option{}, setupFunc)
pool := qjs.NewPool(3, qjs.Option{}, setupFunc)
numWorkers := 5
numTasks := 3
var wg sync.WaitGroup
Expand Down