This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Views should be able to trigger a background flush while they continue processing aka Make Razor flush awesome #1544
Labels
Milestone
This is a proposed enhancement to the flush point support in Razor views.
Currently, views can force a flush to the client by calling FlushAsync, e.g.
This is awesome, but there are two problems:
The proposal is to add a new, string returning
Flush
method to the view (the returned string would be null/empty and is only to allow the simplified call site). This method would attempt aFlushAsync
call inline and if it returned synchronously would do nothing more. If it returned async however, it would return back to the view immediately, while managing the completion of the flush along with coordination with any subsequent calls toFlush
by the view. This way, the view continues to process even though an async flush may currently be in progress. The number/size of outstanding flush operations should be limited so that back-pressure can still be honored, in which case the call toFlush
would block. At the end of the view processing, it would async wait for all outstanding async flush operations until continuing on with response processing.As an example, the view might now look like this:
The text was updated successfully, but these errors were encountered: