Closed rakeshar3796 closed 4 months ago
AsyncLocalHooks
is a nodejs API and cannot track async invocation graphs outside nodejs. You need to manually track these graphs, probably with this API https://nodejs.org/api/async_context.html#class-asyncresource
Thanks @laverdet for the assistance, i fixed it using AsyncResource.bind(myFunction)
Is Your Question Already Answered?
Personal Diagnostics
Please answer the following questions:
JavaScript includes a
setTimeout
function:Functions are a type of primitive value in JavaScript:
Objects can be shared between isolates:
The Code
main.mjs
and then runnode main.mjs
.If i execute this code am able to see the context store value for the first time but on the second function call its returning undefined.
But if i try to make changes in my function
callHost
and comment invokingdelay
function its working as expected, but in my case i need a function similar to this say fetch.So can anyone shed some light on what went wrong here?