Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMethodInterceptor:BeforeInvoke async/await method happen after decorated method #148

Open
htzhang2 opened this issue Mar 15, 2022 · 4 comments

Comments

@htzhang2
Copy link

Castle.Core(4.4.0)
Castle.Core.AsyncInterceptor (1.7.0)

public class ScheduleEventInterceptor : IMethodInterceptor
{
public async void BeforeInvoke(InvocationContext invocationContext)
{
//Expect this call complete before decorated method
await [some_async_call].ConfigureAwait(false);
}
}

Expected: some_async_call execute before decorated method

Actual: some_async_call execute after decorated method.

@JSkimming
Copy link
Owner

What happens if you use Castle.Core.AsyncInterceptor v2?

@htzhang2
Copy link
Author

Same behavior for Castle.Core.AsyncInterceptor (2.0.0)

@JSkimming
Copy link
Owner

@htzhang2 Can you provide a complete example to reproduce? There is no IMethodInterceptor in Castle.Core.AsyncInterceptor.

@htzhang2
Copy link
Author

ok. I will create a sample asp core app to reproduce problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants