How to use AsyncLocalStorage #2238
Unanswered
phoenix741
asked this question in
Q&A
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I have a question for you, i develop a software that use napi-rs to create a node_modules that contains core functionality and node for the rest.
I want to use AsyncLocalStorage for logging (adding information into log).
I have write a rust logger to intercept rust log and transmit this log to nodejs :
In NodeJS i have (using Nest.JS) :
Actually this doesn't work : is loose the context.
My question is how to use AsyncLocalStorage ?
When reading https://nodejs.org/api/n-api.html#napi_async_init we see :
Actually when i use async local storage the context is loose when an api call an napi-rs then call an js callback with ThreadsafeFunction (ie:
Thanks
Beta Was this translation helpful? Give feedback.
All reactions