Skip to content

set_interrupt_handler example usage #49

Answered by andrieshiemstra
SreeniIO asked this question in Q&A
Discussion options

You must be logged in to vote

Hmm yes sorry.. I added the interrupt handler without testing it or adding a test-case

The implementation actually did nothing, I fixed it in the main branch now.

I'm not sure if it will actually work with your code, as far as I can tell the implementation in quickjs is based on calling it every x actions in quickjs, doing a sleep in rust will not add to that count and thus the interrupt handler may not be called.

In my test case I do a for loop with 10k calls and the interrupt handler is called about 4 times.

Hope this helps,

Kind regards.

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@SreeniIO
Comment options

@andrieshiemstra
Comment options

@andrieshiemstra
Comment options

@SreeniIO
Comment options

@andrieshiemstra
Comment options

Answer selected by SreeniIO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants