JSkimming / Castle.Core.AsyncInterceptor

Library to simplify interception of asynchronous methods
Apache License 2.0
295 stars 42 forks source link

Allow to intercept IAsyncEnumerable #226

Open gentledepp opened 9 months ago

gentledepp commented 9 months ago

Hi!

this project is used (among others) in abp.io and is used for client side http-proxy creation based on interfaces.

The poblem I am having is that I would like to "stream" data from the server to the client. I.e. I would like to return an IAsyncEnumerable<WeatherInfo> GetCurrentWeather(string region)

Unfortunately, Castle.DynamicProxy.AsyncInterceptorBase seems to not recognize the return type IAsyncEnumerable<T> and thus calls ProceedSynchronous[IAsyncEnumerable'1]

image

I am not too proficient in using Castle DynamicProxy, but if you give me some hints I am willing to try to contribute this as PR!

Any thoughts?