mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-23 18:50:26 +00:00
Async stream handling: Use interface instead of Func<Stream,Task>
No functional changes
This commit is contained in:
18
MediaBrowser.Controller/Net/IAsyncStreamSource.cs
Normal file
18
MediaBrowser.Controller/Net/IAsyncStreamSource.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using ServiceStack.Web;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IAsyncStreamSource
|
||||
/// Enables asynchronous writing to http resonse streams
|
||||
/// </summary>
|
||||
public interface IAsyncStreamSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Asynchronously write to the response stream.
|
||||
/// </summary>
|
||||
Task WriteToAsync(Stream responseStream);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace MediaBrowser.Controller.Net
|
||||
/// <returns>System.Object.</returns>
|
||||
object GetResult(object content, string contentType, IDictionary<string,string> responseHeaders = null);
|
||||
|
||||
object GetAsyncStreamWriter(Func<Stream,Task> streamWriter, IDictionary<string, string> responseHeaders = null);
|
||||
object GetAsyncStreamWriter(IAsyncStreamSource streamSource);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optimized result.
|
||||
|
||||
Reference in New Issue
Block a user