You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ask should push unhandled answers into deadletter 2 (#5259)
* Ask should push unhandled answers into deadletter
* update future handler
* fix unit test
* remove not needed return
* remove redundant sync lock
* remove redudant code and seal class
* update api spec
* update api spec 2
* handle of Status.Failure
* ask should fail on system messages
_result.TrySetException(f.Exception??newTaskCanceledException("Task cancelled by actor via Failure message."));
145
-
}
146
-
else
147
-
{
148
-
_result.TrySetException(newArgumentException(
149
-
$"Received message of type [{message.GetType()}] - Ask expected message of type [{typeof(T)}]"));
150
-
}
151
-
}
112
+
caseISystemMessagemsg:
113
+
handled=_result.TrySetException(newInvalidOperationException($"system message of type '{msg.GetType().Name}' is invalid for {nameof(FutureActorRef<T>)}"));
114
+
break;
115
+
caseTt:
116
+
handled=_result.TrySetResult(t);
117
+
break;
118
+
casenull:
119
+
handled=_result.TrySetResult(default);
120
+
break;
121
+
caseStatus.Failuref:
122
+
handled=_result.TrySetException(f.Cause
123
+
??newTaskCanceledException("Task cancelled by actor via Failure message."));
124
+
break;
125
+
caseFailuref:
126
+
handled=_result.TrySetException(f.Exception
127
+
??newTaskCanceledException("Task cancelled by actor via Failure message."));
128
+
break;
129
+
default:
130
+
_=_result.TrySetException(newArgumentException(
131
+
$"Received message of type [{message.GetType()}] - Ask expected message of type [{typeof(T)}]"));
0 commit comments