From 122f2738b8039ffe879316ab8bbee9dd99d03434 Mon Sep 17 00:00:00 2001 From: Alvin Date: Mon, 18 Dec 2023 19:20:45 +0800 Subject: [PATCH 1/3] Add default implements for IAsyncObserver and IAsyncBatchObserver --- src/Orleans.Streaming/Core/IAsyncBatchObserver.cs | 4 ++-- src/Orleans.Streaming/Core/IAsyncObserver.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs b/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs index 0a97e78101..06015bca27 100644 --- a/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs +++ b/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs @@ -74,7 +74,7 @@ public interface IAsyncBatchObserver /// /// /// A Task that is completed when the stream-complete operation has been accepted. - Task OnCompletedAsync(); + Task OnCompletedAsync() => Task.CompletedTask; /// /// Notifies the consumer that the stream had an error. @@ -84,6 +84,6 @@ public interface IAsyncBatchObserver /// /// An Exception that describes the error that occurred on the stream. /// A Task that is completed when the close has been accepted. - Task OnErrorAsync(Exception ex); + Task OnErrorAsync(Exception ex) => throw ex; } } diff --git a/src/Orleans.Streaming/Core/IAsyncObserver.cs b/src/Orleans.Streaming/Core/IAsyncObserver.cs index b487ddcc1d..96aafcb726 100644 --- a/src/Orleans.Streaming/Core/IAsyncObserver.cs +++ b/src/Orleans.Streaming/Core/IAsyncObserver.cs @@ -46,7 +46,7 @@ public interface IAsyncObserver /// /// /// A Task that is completed when the stream-complete operation has been accepted. - Task OnCompletedAsync(); + Task OnCompletedAsync() => Task.CompletedTask; /// /// Notifies the consumer that the stream had an error. @@ -56,6 +56,6 @@ public interface IAsyncObserver /// /// An Exception that describes the error that occurred on the stream. /// A Task that is completed when the close has been accepted. - Task OnErrorAsync(Exception ex); + Task OnErrorAsync(Exception ex) => throw ex; } } From 6bc9fafad50d29ef4fcd4f5665eb0bf232692590 Mon Sep 17 00:00:00 2001 From: Alvin <10202306+bluexo@users.noreply.github.com> Date: Sat, 23 Dec 2023 07:12:53 +0800 Subject: [PATCH 2/3] Update IAsyncBatchObserver.cs --- src/Orleans.Streaming/Core/IAsyncBatchObserver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs b/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs index 06015bca27..c4dd4e40c7 100644 --- a/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs +++ b/src/Orleans.Streaming/Core/IAsyncBatchObserver.cs @@ -84,6 +84,6 @@ public interface IAsyncBatchObserver /// /// An Exception that describes the error that occurred on the stream. /// A Task that is completed when the close has been accepted. - Task OnErrorAsync(Exception ex) => throw ex; + Task OnErrorAsync(Exception ex); } } From bfe3f209b9e1f6b52b884a5999d0207b52290423 Mon Sep 17 00:00:00 2001 From: Alvin <10202306+bluexo@users.noreply.github.com> Date: Sat, 23 Dec 2023 07:13:18 +0800 Subject: [PATCH 3/3] Update IAsyncObserver.cs --- src/Orleans.Streaming/Core/IAsyncObserver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orleans.Streaming/Core/IAsyncObserver.cs b/src/Orleans.Streaming/Core/IAsyncObserver.cs index 96aafcb726..795bf9bf3f 100644 --- a/src/Orleans.Streaming/Core/IAsyncObserver.cs +++ b/src/Orleans.Streaming/Core/IAsyncObserver.cs @@ -56,6 +56,6 @@ public interface IAsyncObserver /// /// An Exception that describes the error that occurred on the stream. /// A Task that is completed when the close has been accepted. - Task OnErrorAsync(Exception ex) => throw ex; + Task OnErrorAsync(Exception ex); } }