Hi, In Sample12 async trace, it says we should intercept a method initiating an async task and create/record a new AsyncContext, so it intercepts TargetClass12_AsyncInitiator's method asyncHello then intercepts TargetClass12_Worker constructor method to get theAsyncContext passed by AsyncInitiatorInterceptor.
My question is why not create/record a new AsyncContext in the TargetClass12_Worker constructor method interceptor, since TargetClass12_Worker's constructor method is executed in current thread while it's run method executed in another thread, So we can remove AsyncInitiatorInterceptor.
Hi, In Sample12 async trace, it says we should intercept a method initiating an async task and create/record a new
AsyncContext
, so it interceptsTargetClass12_AsyncInitiator
's methodasyncHello
then interceptsTargetClass12_Worker
constructor method to get theAsyncContext
passed byAsyncInitiatorInterceptor
. My question is why not create/record a newAsyncContext
in theTargetClass12_Worker
constructor method interceptor, sinceTargetClass12_Worker
's constructor method is executed in current thread while it's run method executed in another thread, So we can remove AsyncInitiatorInterceptor.