Closed jerviscui closed 2 years ago
Hi @jerviscui , we're currently working on more sophisticated version of Universal Wrapper here #148.
Apart of that I was long thinking about what you're suggesting - to make aspect compiler recognize and process async methods in different way. It would require some significant changes, so until then I guess upcoming version of #148 will do the trick
I guess this should cover it https://github.com/pamidur/aspect-injector/pull/148 Feel free to reopen if needed
The UniversalWrapper.cs, if used for a sync method and return Task:
Will thorw a convert exception in
(Task<T>)target(args)
._asyncHandler
need to add a check conditionsmethodInfo.GetCustomAttributes<AsyncStateMachineAttribute>().Any()
conditions.And UniversalWrapper use
MethodBase.Invoke()
method, I thinkInvoke()
function doesn't have good performance.How about add a async Around method for async method?
I don't know if I am right. Just a thought.