Skip to content

Commit 2229b36

Browse files
simkesstForNeVeR
authored andcommitted
rdcall: identify bindable result when local wire review fix
1 parent 0f16a6c commit 2229b36

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

rd-net/RdFramework/Tasks/RdCall.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,13 @@ private IRdTask<TRes> StartInternal(Lifetime requestLifetime, TReq request, ISch
201201
var taskResult = RunHandler(request, task.Lifetime, moniker: this).Result;
202202
taskResult.AdviseOnce(requestLifetime, result =>
203203
{
204-
task.OnResultReceived(proto, result, new SynchronousDispatchHelper(RdId, requestLifetime), true);
204+
if (result.Result.IsBindable())
205+
{
206+
// we mock the endpoint side, since we are on stub wire, so identify bindable result here
207+
result.Result.IdentifyPolymorphic(proto.Identities, RdId.Mix(taskId.ToString()));
208+
}
209+
210+
task.OnResultReceived(result, new SynchronousDispatchHelper(taskId, requestLifetime));
205211
});
206212
return task;
207213
}

rd-net/RdFramework/Tasks/WiredRdTask.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public override void OnWireReceived(IProtocol proto, SerializationCtx ctx, Unsaf
9393
{
9494
// we are at call side, so listening no response and bind it if it's bindable
9595
var taskResult = RdTaskResult<TRes>.Read(myCall.ReadResponseDelegate, ctx, reader);
96-
OnResultReceived(proto, taskResult, dispatchHelper, false);
96+
OnResultReceived(taskResult, dispatchHelper);
9797
}
9898

99-
internal void OnResultReceived(IProtocol? proto, RdTaskResult<TRes> taskResult, IRdWireableDispatchHelper dispatchHelper, bool isLocalWire)
99+
internal void OnResultReceived(RdTaskResult<TRes> taskResult, IRdWireableDispatchHelper dispatchHelper)
100100
{
101101
Trace(RdReactiveBase.ourLogReceived, "received response", taskResult);
102102

@@ -110,12 +110,6 @@ internal void OnResultReceived(IProtocol? proto, RdTaskResult<TRes> taskResult,
110110
var potentiallyBindable = taskResult.Result;
111111
if (potentiallyBindable.IsBindable())
112112
{
113-
if (proto != null && isLocalWire)
114-
{
115-
// we don't have the endpoint side, since we are on stub wire, so identify bindable result here
116-
potentiallyBindable.IdentifyPolymorphic(proto.Identities, myCall.RdId.Mix(RdId.ToString()));
117-
}
118-
119113
var definition = new LifetimeDefinition { Id = potentiallyBindable };
120114

121115
try

0 commit comments

Comments
 (0)