From dbdc9dcd987d9e58eef5050954c6878e588472fb Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Fri, 21 Jun 2024 12:56:16 +0900 Subject: [PATCH] Update IStreamingHubDiagnosticHandler API --- .../StaticStreamingHubClientGenerator.cs | 27 ++++++++++++-- .../IStreamingHubDiagnosticHandler.cs | 19 ++++++++++ .../IStreamingHubDiagnosticHandler.cs | 19 ++++++++++ .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0004_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0004_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 6 ++-- .../0003_TempProject_MyHubClient.g.cs | 12 +++---- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 6 ++-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 6 ++-- .../0003_TempProject_MyHubClient.g.cs | 8 ++--- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0004_TempProject_MyHubClient.g.cs | 4 +-- .../Return/0003_TempProject_MyHubClient.g.cs | 6 ++-- .../0003_TempProject_MyHubClient.g.cs | 12 +++---- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0004_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 6 ++-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 6 ++-- .../0003_TempProject_MyHubClient.g.cs | 8 ++--- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0004_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 21 +++++++---- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../Complex/0003_TempProject_MyHubClient.g.cs | 12 +++---- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 8 ++--- .../0003_TempProject_MyHubClient.g.cs | 2 +- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- .../0003_TempProject_MyHubClient.g.cs | 4 +-- ...StreamingHubClientDiagnosticHandlerTest.cs | 35 ++++++++++++++----- 58 files changed, 213 insertions(+), 128 deletions(-) diff --git a/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs b/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs index 271ca40bb..33ac5aafb 100644 --- a/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs +++ b/src/MagicOnion.Client.SourceGenerator/CodeGen/StaticStreamingHubClientGenerator.cs @@ -304,6 +304,14 @@ static void EmitOnBroadcastEvent(StreamingHubClientBuildContext ctx) ctx.Writer.AppendLine(""" protected override void OnBroadcastEvent(global::System.Int32 methodId, global::System.ReadOnlyMemory data) { + """); + if (ctx.EnableStreamingHubDiagnosticHandler) + { + ctx.Writer.AppendLine(""" + diagnosticHandler?.OnBroadcastEventRaw(this, methodId, data); + """); + } + ctx.Writer.AppendLine(""" switch (methodId) { """); @@ -356,18 +364,31 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: static void EmitOnResponseEvent(StreamingHubClientBuildContext ctx) { ctx.Writer.AppendLine(""" - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { """); foreach (var method in ctx.Hub.Methods) { - ctx.Writer.AppendLineWithFormat($$""" + if (ctx.EnableStreamingHubDiagnosticHandler) + { + ctx.Writer.AppendLineWithFormat($$""" + case {{method.HubId}}: // {{method.MethodReturnType.ToDisplayName()}} {{method.MethodName}}({{method.Parameters.ToMethodSignaturize()}}) + diagnosticHandler?.OnResponseEvent<{{ctx.Hub.GetClientFullName()}}, {{method.ResponseType.FullName}}>(this, "{{method.MethodName}}", data); + base.SetResultForResponse<{{method.ResponseType.FullName}}>(taskSource, data); + break; + """); + } + else + { + ctx.Writer.AppendLineWithFormat($$""" case {{method.HubId}}: // {{method.MethodReturnType.ToDisplayName()}} {{method.MethodName}}({{method.Parameters.ToMethodSignaturize()}}) - base.SetResultForResponse<{{method.ResponseType.FullName}}>(taskCompletionSource, data); + base.SetResultForResponse<{{method.ResponseType.FullName}}>(taskSource, data); break; """); + + } } ctx.Writer.AppendLine(""" } diff --git a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs index f810af8d5..83f6a513f 100644 --- a/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs +++ b/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs @@ -24,6 +24,15 @@ public interface IStreamingHubDiagnosticHandler /// ValueTask OnMethodInvoke(THub hubInstance, int methodId, string methodName, TRequest request, bool isFireAndForget, InvokeMethodDelegate invokeMethod); + /// + /// [Preview] The callback method when a method of HubReceiver is invoked. This API may change in the future. + /// + /// + /// + /// + /// + void OnBroadcastEventRaw(THub hubInstance, int methodId, ReadOnlyMemory data); + /// /// [Preview] The callback method when a method of HubReceiver is invoked. This API may change in the future. /// @@ -33,5 +42,15 @@ public interface IStreamingHubDiagnosticHandler /// /// void OnBroadcastEvent(THub hubInstance, string methodName, T value); + + /// + /// [Preview] The callback method when the return value of a hub method call is received. This API may change in the future. + /// + /// + /// + /// + /// + /// + void OnResponseEvent(THub hubInstance, string methodName, ReadOnlyMemory data); } } diff --git a/src/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs b/src/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs index f810af8d5..83f6a513f 100644 --- a/src/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs +++ b/src/MagicOnion.Client/IStreamingHubDiagnosticHandler.cs @@ -24,6 +24,15 @@ public interface IStreamingHubDiagnosticHandler /// ValueTask OnMethodInvoke(THub hubInstance, int methodId, string methodName, TRequest request, bool isFireAndForget, InvokeMethodDelegate invokeMethod); + /// + /// [Preview] The callback method when a method of HubReceiver is invoked. This API may change in the future. + /// + /// + /// + /// + /// + void OnBroadcastEventRaw(THub hubInstance, int methodId, ReadOnlyMemory data); + /// /// [Preview] The callback method when a method of HubReceiver is invoked. This API may change in the future. /// @@ -33,5 +42,15 @@ public interface IStreamingHubDiagnosticHandler /// /// void OnBroadcastEvent(THub hubInstance, string methodName, T value); + + /// + /// [Preview] The callback method when the return value of a hub method call is received. This API may change in the future. + /// + /// + /// + /// + /// + /// + void OnResponseEvent(THub hubInstance, string methodName, ReadOnlyMemory data); } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs index 677b6e9e3..75f421b17 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver/0003_TempProject_MyHubClient.g.cs @@ -58,7 +58,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 483411f3a..c1c7c5491 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -76,7 +76,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 3879e511e..cdee569d1 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -52,7 +52,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs index fec15f00e..31e503b75 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Enum/0004_TempProject_MyHubClient.g.cs @@ -52,7 +52,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 11d471cac..12e7186c8 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -58,7 +58,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 1adb4e3e3..72380506c 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -52,7 +52,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs index ba049d815..858e700ba 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs @@ -58,7 +58,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs index e93afc026..752fb3779 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested/0003_TempProject_MyHubClient.g.cs @@ -64,7 +64,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs index df0c06eff..252972ec7 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Array/0003_TempProject_MyHubClient.g.cs @@ -52,7 +52,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs index a94813684..180c87241 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/HubReceiver_Nested_Enum/0004_TempProject_MyHubClient.g.cs @@ -52,7 +52,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs index 6021d9c91..b648c2931 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters/0003_TempProject_MyHubClient.g.cs @@ -54,15 +54,15 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyGenericObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -955516027: // Task B(global::TempProject.MyGenericObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 586f9a79a..4f5b85633 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -66,24 +66,24 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case 1774317884: // Task GetStringValuesAsync(global::System.String[] arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -400881550: // Task GetIntValuesAsync(global::System.Int32[] arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case 309063297: // Task GetInt32ValuesAsync(global::System.Int32[] arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case 702446639: // Task GetSingleValuesAsync(global::System.Single[] arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case 2082077357: // Task GetBooleanValuesAsync(global::System.Boolean[] arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 23fb6e31c..b576e7dbc 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -209315513: // Task GetValuesAsync(global::TempProject.MyResponse[] arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index ad5bc510e..5445b567a 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -54,15 +54,15 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case 1774317884: // Task GetStringValuesAsync(global::System.Collections.Generic.List arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -400881550: // Task GetIntValuesAsync(global::System.Collections.Generic.List arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs index c4672b1b9..db01303f2 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -209315513: // Task GetValuesAsync(global::System.Collections.Generic.List arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs index a09022437..7c11f6bbf 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs @@ -54,15 +54,15 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyGenericObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -955516027: // Task B(global::TempProject.MyGenericObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs index 6f6c1747c..b72a57709 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested/0003_TempProject_MyHubClient.g.cs @@ -58,18 +58,18 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyGenericObject> a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -955516027: // Task B(global::TempProject.MyGenericObject>> a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -972293646: // Task C(global::TempProject.MyGenericObject>> a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs index 56321130c..10e774b9d 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Array/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -209315513: // Task GetValuesAsync(global::TempProject.MyGenericObject arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs index fcc8c2b4c..e98368397 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Parameters_Nested_Enum/0004_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1221306238: // Task GetEnumAsync(global::TempProject.MyGenericObject> arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs index a14aec673..4b35c15c6 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return/0003_TempProject_MyHubClient.g.cs @@ -54,15 +54,15 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task> A() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; case -955516027: // Task> B() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 2176b164b..43295a73a 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -66,24 +66,24 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case 1774317884: // Task GetStringValuesAsync() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -400881550: // Task GetIntValuesAsync() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case 309063297: // Task GetInt32ValuesAsync() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case 702446639: // Task GetSingleValuesAsync() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case 2082077357: // Task GetBooleanValuesAsync() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs index c691dadbc..6dfe3183c 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ArrayFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -209315513: // Task GetValuesAsync() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs index 7171d634d..ef68de599 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Enum/0004_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1221306238: // Task> GetEnumAsync() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs index 8aa71f1ec..f541f8e8f 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_KnownType/0003_TempProject_MyHubClient.g.cs @@ -54,15 +54,15 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case 1774317884: // Task> GetStringValuesAsync() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; case -400881550: // Task> GetIntValuesAsync() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs index 4d1889aeb..812b5ffee 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_ListFormatter_UserType/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -209315513: // Task> GetValuesAsync() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs index 714b3a925..79f48379c 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_MultipleTypeArgs/0003_TempProject_MyHubClient.g.cs @@ -54,15 +54,15 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task> A() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; case -955516027: // Task> B() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs index 51f12117d..199ee5d25 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested/0003_TempProject_MyHubClient.g.cs @@ -58,18 +58,18 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task>> A() - base.SetResultForResponse>>(taskCompletionSource, data); + base.SetResultForResponse>>(taskSource, data); break; case -955516027: // Task>>> B() - base.SetResultForResponse>>>(taskCompletionSource, data); + base.SetResultForResponse>>>(taskSource, data); break; case -972293646: // Task>>> C() - base.SetResultForResponse>>>(taskCompletionSource, data); + base.SetResultForResponse>>>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs index 5ae455add..d04540be5 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Array/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -209315513: // Task> GetValuesAsync() - base.SetResultForResponse>(taskCompletionSource, data); + base.SetResultForResponse>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs index a41c771c4..4bf898738 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateGenericsStreamingHubTest/Return_Nested_Enum/0004_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1221306238: // Task>> GetEnumAsync() - base.SetResultForResponse>>(taskCompletionSource, data); + base.SetResultForResponse>>(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubDiagnosticHandlerTest/Generate/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubDiagnosticHandlerTest/Generate/0003_TempProject_MyHubClient.g.cs index 906ec9fff..864d07f0c 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubDiagnosticHandlerTest/Generate/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubDiagnosticHandlerTest/Generate/0003_TempProject_MyHubClient.g.cs @@ -130,6 +130,7 @@ public FireAndForgetClient(TempProject_MyHubClient parent) protected override void OnBroadcastEvent(global::System.Int32 methodId, global::System.ReadOnlyMemory data) { + diagnosticHandler?.OnBroadcastEventRaw(this, methodId, data); switch (methodId) { case -1005848884: // Void A() @@ -149,27 +150,33 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case 1497325507: // Task MethodA() - base.SetResultForResponse(taskCompletionSource, data); + diagnosticHandler?.OnResponseEvent(this, "MethodA", data); + base.SetResultForResponse(taskSource, data); break; case 1514103126: // Task MethodB() - base.SetResultForResponse(taskCompletionSource, data); + diagnosticHandler?.OnResponseEvent(this, "MethodB", data); + base.SetResultForResponse(taskSource, data); break; case 1530880745: // ValueTask MethodC() - base.SetResultForResponse(taskCompletionSource, data); + diagnosticHandler?.OnResponseEvent(this, "MethodC", data); + base.SetResultForResponse(taskSource, data); break; case 1547658364: // ValueTask MethodD() - base.SetResultForResponse(taskCompletionSource, data); + diagnosticHandler?.OnResponseEvent(this, "MethodD", data); + base.SetResultForResponse(taskSource, data); break; case 1564435983: // Task MethodE(global::System.Int32 arg0, global::System.String arg1) - base.SetResultForResponse(taskCompletionSource, data); + diagnosticHandler?.OnResponseEvent(this, "MethodE", data); + base.SetResultForResponse(taskSource, data); break; case 1581213602: // Task MethodF(global::System.Int32 arg0, global::System.String arg1, global::System.Boolean arg2) - base.SetResultForResponse(taskCompletionSource, data); + diagnosticHandler?.OnResponseEvent(this, "MethodF", data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many/0003_TempProject_MyHubClient.g.cs index a09c79378..7578f821c 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_NoReturnValue/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_NoReturnValue/0003_TempProject_MyHubClient.g.cs index bf38bbd35..2297c31f9 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_NoReturnValue/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_NoReturnValue/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_With_Cancellation/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_With_Cancellation/0003_TempProject_MyHubClient.g.cs index ffe51a96d..af1fbfad5 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_With_Cancellation/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Many_With_Cancellation/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One/0003_TempProject_MyHubClient.g.cs index f7c21cc11..a2287e16f 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_NoReturnValue/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_NoReturnValue/0003_TempProject_MyHubClient.g.cs index 121b3b386..cb3b54038 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_NoReturnValue/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_NoReturnValue/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_With_Cancellation/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_With_Cancellation/0003_TempProject_MyHubClient.g.cs index 03e7acbe8..6494049ff 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_With_Cancellation/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_One_With_Cancellation/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero/0003_TempProject_MyHubClient.g.cs index 4e019aed6..bfe89fadd 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_NoReturnValue/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_NoReturnValue/0003_TempProject_MyHubClient.g.cs index 1291c58a6..90f7ea7b2 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_NoReturnValue/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_NoReturnValue/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_With_Cancellation/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_With_Cancellation/0003_TempProject_MyHubClient.g.cs index 5971df598..5382fa08a 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_With_Cancellation/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/ClientResult_Parameter_Zero_With_Cancellation/0003_TempProject_MyHubClient.g.cs @@ -46,7 +46,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs index f43e332f9..c0adefdfa 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Complex/0003_TempProject_MyHubClient.g.cs @@ -83,24 +83,24 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -955516027: // Task B(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -972293646: // Task C(global::TempProject.MyObject a, global::System.String b) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -1056181741: // Task D(global::TempProject.MyObject a, global::System.String b, global::System.Int32 c) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -1072959360: // Task E(global::TempProject.MyObject a, global::System.String b, global::System.Int32 c) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs index 850c5654d..3df831f2e 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Many/0003_TempProject_MyHubClient.g.cs @@ -56,12 +56,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs index 44f7bcbc7..8a73d52db 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_One/0003_TempProject_MyHubClient.g.cs @@ -56,12 +56,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs index 1ebfbb12d..1e3604497 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/HubReceiver_Parameter_Zero/0003_TempProject_MyHubClient.g.cs @@ -55,12 +55,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance/0003_TempProject_MyHubClient.g.cs index becdd8df0..df94570d6 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance/0003_TempProject_MyHubClient.g.cs @@ -58,18 +58,18 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -972293646: // Task C() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; case -955516027: // Task B() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance_Receiver/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance_Receiver/0003_TempProject_MyHubClient.g.cs index 9acecb504..d811e51b4 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance_Receiver/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/InterfaceInheritance_Receiver/0003_TempProject_MyHubClient.g.cs @@ -61,7 +61,7 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs index 5eac2512c..cad80577a 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Many/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::System.String arg0, global::System.Int32 arg1, global::System.Boolean arg2) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs index 46e51850a..a714f5f8d 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_One/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::System.String arg0) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs index c19a7c4f2..20e896827 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Parameter_Zero/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs index 8d7466ee4..321ab9f68 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Task/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs index 7c5bd8419..0b1bd9556 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_TaskOfT/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs index 97f31c6e6..4971d9c80 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTask/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // ValueTask A(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs index 1c6c247ee..93c3f7cf9 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_ValueTaskOfT/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // ValueTask A(global::TempProject.MyObject a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Void/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Void/0003_TempProject_MyHubClient.g.cs index 2c32a22fa..98768e2df 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Void/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateStreamingHubTest/Return_Void/0003_TempProject_MyHubClient.g.cs @@ -50,12 +50,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Void A() - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs index 3b9fbb6c2..84f371394 100644 --- a/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs +++ b/tests/MagicOnion.Client.SourceGenerator.Tests/Resources/GenerateWithIfDirectiveTest/Skip_Generation_StreamingHub_Interface/0003_TempProject_MyHubClient.g.cs @@ -56,12 +56,12 @@ protected override void OnBroadcastEvent(global::System.Int32 methodId, global:: } } - protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskCompletionSource, global::System.ReadOnlyMemory data) + protected override void OnResponseEvent(global::System.Int32 methodId, global::System.Object taskSource, global::System.ReadOnlyMemory data) { switch (methodId) { case -1005848884: // Task A(global::System.Int32 a) - base.SetResultForResponse(taskCompletionSource, data); + base.SetResultForResponse(taskSource, data); break; } } diff --git a/tests/MagicOnion.Integration.Tests/StreamingHubClientDiagnosticHandlerTest.cs b/tests/MagicOnion.Integration.Tests/StreamingHubClientDiagnosticHandlerTest.cs index 467952818..95012e464 100644 --- a/tests/MagicOnion.Integration.Tests/StreamingHubClientDiagnosticHandlerTest.cs +++ b/tests/MagicOnion.Integration.Tests/StreamingHubClientDiagnosticHandlerTest.cs @@ -31,7 +31,7 @@ public async Task Request_Response() var result = await client.Parameter_Many(12345, "Hello✨", true); // Assert - Assert.Equal([DiagnosticHandler.EventType.OnRequestBegin, DiagnosticHandler.EventType.OnRequestEnd], diagnosticHandler.Events.Select(x => x.EventType)); + Assert.Equal([DiagnosticHandler.EventType.OnRequestBegin, DiagnosticHandler.EventType.OnResponseEvent, DiagnosticHandler.EventType.OnRequestEnd], diagnosticHandler.Events.Select(x => x.EventType)); var beginEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestBegin); var endEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestEnd); @@ -61,7 +61,7 @@ public async Task Request_Parameterless_Response() var result = await client.Parameter_Zero(); // Assert - Assert.Equal([DiagnosticHandler.EventType.OnRequestBegin, DiagnosticHandler.EventType.OnRequestEnd], diagnosticHandler.Events.Select(x => x.EventType)); + Assert.Equal([DiagnosticHandler.EventType.OnRequestBegin, DiagnosticHandler.EventType.OnResponseEvent, DiagnosticHandler.EventType.OnRequestEnd], diagnosticHandler.Events.Select(x => x.EventType)); var beginEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestBegin); var endEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestEnd); @@ -91,15 +91,19 @@ public async Task Request_Response_Void() await client.NoReturn_Parameter_Many(12345, "Hello✨", true); // Assert - Assert.Equal([DiagnosticHandler.EventType.OnRequestBegin, DiagnosticHandler.EventType.OnRequestEnd], diagnosticHandler.Events.Select(x => x.EventType)); + Assert.Equal([DiagnosticHandler.EventType.OnRequestBegin, DiagnosticHandler.EventType.OnResponseEvent, DiagnosticHandler.EventType.OnRequestEnd], diagnosticHandler.Events.Select(x => x.EventType)); var beginEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestBegin); var endEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestEnd); + var responseEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnResponseEvent); Assert.Equal(nameof(IStreamingHubTestHub.NoReturn_Parameter_Many), beginEvent.MethodName); Assert.Equal(nameof(IStreamingHubTestHub.NoReturn_Parameter_Many), endEvent.MethodName); Assert.Equal(new DynamicArgumentTuple(12345, "Hello✨", true), beginEvent.Request); Assert.Equal(Nil.Default, endEvent.Response); + + Assert.Equal(nameof(IStreamingHubTestHub.NoReturn_Parameter_Many), responseEvent.MethodName); + Assert.Equal([192], (byte[])responseEvent.Response!); } [Fact] @@ -161,6 +165,7 @@ public async Task Receiver() var beginEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestBegin); var endEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnRequestEnd); var broadcastEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnBroadcastEvent); + var broadcastRawEvent = diagnosticHandler.Events.Single(x => x.EventType == DiagnosticHandler.EventType.OnBroadcastEventRaw); Assert.Equal(nameof(IStreamingHubTestHub.CallReceiver_Parameter_Many), beginEvent.MethodName); Assert.Equal(nameof(IStreamingHubTestHub.CallReceiver_Parameter_Many), endEvent.MethodName); @@ -169,38 +174,52 @@ public async Task Receiver() Assert.Equal(nameof(IStreamingHubTestHubReceiver.Receiver_Parameter_Many), broadcastEvent.MethodName); Assert.Equal(new DynamicArgumentTuple(12345, "Hello✨", true), broadcastEvent.Response); + Assert.Equal(283674770, broadcastRawEvent.MethodId); + Assert.NotEmpty((byte[])broadcastRawEvent.Response!); } class DiagnosticHandler : IStreamingHubDiagnosticHandler { public enum EventType { + OnResponseEvent, OnRequestBegin, OnRequestEnd, OnBroadcastEvent, + OnBroadcastEventRaw, } - public List<(EventType EventType, object HubInstance, string MethodName, object? Request, object? Response, Exception? Exception)> Events { get; } = new (); + public List<(EventType EventType, object HubInstance, string MethodName, int MethodId, object? Request, object? Response, Exception? Exception)> Events { get; } = new (); public async ValueTask OnMethodInvoke(THub hubInstance, int methodId, string methodName, TRequest request, bool isFireAndForget, IStreamingHubDiagnosticHandler.InvokeMethodDelegate invokeMethod) { - Events.Add((EventType.OnRequestBegin, hubInstance!, methodName, request, default, default)); + Events.Add((EventType.OnRequestBegin, hubInstance!, methodName, methodId, request, default, default)); try { var result = await invokeMethod(methodId, request).ConfigureAwait(false); - Events.Add((EventType.OnRequestEnd, hubInstance!, methodName, default, result, default)); + Events.Add((EventType.OnRequestEnd, hubInstance!, methodName, methodId, default, result, default)); return result; } catch (Exception e) { - Events.Add((EventType.OnRequestEnd, hubInstance!, methodName, default, default, e)); + Events.Add((EventType.OnRequestEnd, hubInstance!, methodName, methodId, default, default, e)); throw; } } + public void OnBroadcastEventRaw(THub hubInstance, int methodId, ReadOnlyMemory data) + { + Events.Add((EventType.OnBroadcastEventRaw, hubInstance!, string.Empty, methodId, default, data.ToArray(), default)); + } + public void OnBroadcastEvent(THub hubInstance, string methodName, T value) { - Events.Add((EventType.OnBroadcastEvent, hubInstance!, methodName, default, value, default)); + Events.Add((EventType.OnBroadcastEvent, hubInstance!, methodName, 0, default, value, default)); + } + + public void OnResponseEvent(THub hubInstance, string methodName, ReadOnlyMemory data) + { + Events.Add((EventType.OnResponseEvent, hubInstance!, methodName, 0, default, data.ToArray(), default)); } } }