`executionScopeDepth` does not make sense if concurrent async operations
Closed this issue · 1 comments
cspotcode commented
As far as I can tell, executionScopeDepth
doesn't really make sense if multiple async operations are happening at once. Rather than being a "depth," it sounds like it represents the total # of active async contexts, right? In an active server, it may never reach 0. Is my interpretation correct?
AndreasMadsen commented
it sounds like it represents the total # of active async contexts
Only in the current turn (partial tick) of the process.
In an active server, it may never reach 0. Is my interpretation correct?
It most definitely will each 0. Again, the depth is only in terms of layered execution of emitBefore
. An example is setTimeout
. In most cases executionScopeDepth
will either be 1 or 0.