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

shouldInterrupt for the amount of statements #209

Open
Attacler opened this issue Oct 15, 2024 · 1 comment
Open

shouldInterrupt for the amount of statements #209

Attacler opened this issue Oct 15, 2024 · 1 comment

Comments

@Attacler
Copy link

Hi there,

We are currently looking for a library that safely executes code and where we can limit the amount of statements executed.
I do see the shouldInterruptAfterDeadline function but there are no others.
Is there anything comming for this or should we look into other libraries?

Thanks in advance for responding :)

@Entkenntnis
Copy link

Entkenntnis commented Jan 8, 2025

Documented in quickjs source code, the interrupt handler is called every 10k cycles (which rougly translated to this amount of statements). It's not perfectly granular, but suitable for sandboxing use cases. The example would interrupt after rougly ~10 million statements.

grafik

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