Open peaksnail opened 8 years ago
Hi! If you have a webapp may be this approach will help you. I decided to put expressjs response object in the context and added this to the lib.
I am interested in this as well. This functionality could be added with some kind of event when the context exits. I don't know the performance implications of adding this however.
Our use case is for our tracing library to automatically instrument code. For cases following a request/response pattern (i.e. web frameworks) it's easy to know when to finish the span. However, for cases like message queue consumers or task workers, it can be difficult to know when to finish the span since there is no explicit callback or response. In this case, the only way to know that the span is finished right now is for the user to explicitly finish it. It would be really useful to be able to know when the context has exited to automatically finish the span.
@othiym23 I believe you have created this library for a similar use case? Any insight on this would be appreciated :)
hi I want to know when current callstack finished, and then I will do some other things after that; I debug the function exit in the finally of namespace.bind or run, But It couldn't work Is there some good way to know when current callstack finished(include callback)?
thanks zeng