Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a feature called "Client results," which allows the server to invoke client methods and receive results.
"Client results" is inspired by a feature of the same name implemented in SignalR. This enables invoking a particular client's method from the server's Hub or application logic and receiving results.
On the server, method calls can be made through
Client
orSingle
of the group, and the result can be received.Exceptions
If an error occurs on the client, an
RpcException
is thrown to the caller, and if the connection is disconnected or a timeout occurs, aTaskCanceledException
(OperationCanceledException
) is thrown.Timeout
The timeout for server-to-client calls is 5 seconds by default. If the timeout is exceeded, a
TaskCanceledException
(OperationCanceledException
) is thrown to the caller. The default timeout can be set via theMagicOnionOptions.ClientResultsDefaultTimeout
property.To explicitly override the timeout per method call, specify a
CancellationToken
as a method argument and pass in theCancellationToken
to timeout at any desired timing. Note that this cancellation does not propagate to the client; the client always receivesdefault(CancellationToken)
.Limitations
Client
orSingle
.