JacobZwang
How to import enums from npm:typescript package?
The following code crashes because the enum is undefined at runtime.
I think this issue is related, but I can't figure out how to actually solve this. https://github.com/denoland/deno/issues/7605
I tried running it in Bun and it worked as expected and I can't find any compiler options in deno that seem related. How should I fix this?
6 replies
block js with #[op2] fn without blocking rust thread
I'm using deno_core and I'm looking for a way to block the js main thread without using a sync function to block rust's thread.
Basically what should happen is:
1. op_sleep is called from js.
2. rust pauses the js runtime for 1 second. during this 1 second, rust thread is can still be executing other isolates on the same thread.
3. after 1 second ends, rust resumes the js runtime.
Is this possible using deno_core and op2 or do I need to use lower level apis?
2 replies