AspNetCoreOData
AspNetCoreOData copied to clipboard
Async query enumeration and cancellation support for long running queries
Note: I've reopened this PR since the target branch name changes to main. The original PR can be found here: https://github.com/OData/AspNetCoreOData/pull/324 and was already approved by @corranrogue9.
A long time ago I created an issue to properly cancel long running queries (when the HttpContext.RequestAborted cancellation token is triggered) for the 7.9 version of this code. This was never solved, I think mainly because most of the code is still synchronous.
Now that I moved on to AspNetCoreOData I'm facing the same problem and gave it another shot.
@xuzhg I know that this PR is far from complete. But I wanted to get an opinion from you if I'm moving in the right direction with this and if you would approve this PR once it's complete before I put more effort in this.
For now, I have mainly redesigned the TruncatedCollection to properly support async enumeration (and remove the buffering of the whole response along with this change) as well as the ODataResourceSetSerializer.
So, for paged queries, this approach works.
@KenitoInc Is there anything I can to to speed up the review?
Thanks for the review @corranrogue9. I'm a little swamped right now but will get back to this ASAP.
@henning-krause hoping you'd be able to complete this sometime! Would be cool if cancellation token is going to be supported.
@henning-krause any chance?
@SymbioticKilla Unfortunately, I won't have time for this in the foreseeable future.