Skip to content

Conversation

@Shnitzelil
Copy link

The previous implementation creates New Runtime.
If you already have one you may now use it.

@dop251
Copy link
Owner

dop251 commented Sep 4, 2025

The current design is deliberate (see #91). To add to that, if you need to run initialisation code to set up the *Runtime, you can do that using loop.RunOnLoop(), i.e.

	loop := NewEventLoop()
	loop.Start()
	defer loop.Stop()

	ch := make(chan error)
	loop.RunOnLoop(func(r *goja.Runtime) {
		r.SetMaxCallStackSize(1000)
		// ... More initialisation
		ch <- nil
	})
	err := <-ch

	if err != nil {
		// Handle error
	}

@Shnitzelil
Copy link
Author

Thank you for your input.
This is a kind of workaround.
Please consider my idea.

Thank you

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

Successfully merging this pull request may close these issues.

2 participants