Integrating JsRuntime properly with Axum #20957
Unanswered
Toasterson
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all.
I am using deno_core as a Javascript runtime for me to make a webhook server. I am making the Webserver part in axum and at the moment I make a JsRuntime in every handler, that gets called. I tried to do the more resonable shared state approach but many things inside the JsRuntime do not implement sync so I cant add it to the shared state.
My current handler looks like this:
Does it make sense to run the JsRuntime::new() calls globally once or is that ok inside the handler like in the example? If it is better to run global, is it easy to call create_realm to create a realm? Is there a realm example, that cleans up after the functions has ended?
Beta Was this translation helpful? Give feedback.
All reactions