Replace Single(connectionId) with Client(connectionId) and Caller #41994
Labels
api-approved
API was approved in API review, it can be implemented
area-signalr
Includes: SignalR clients and servers
breaking-change
This issue / pr will introduce a breaking change, when resolved / merged.
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Background and Motivation
When approving API for #5280 we considered replacing
Single
withnew Caller
andnew Client
members but we were worried it would be source breaking because:However further investigation shows that we can add
new
Caller
andClient
members without breaking existingIHubClients
andIHubCallerClients
implementations unless they're being used for client results which never worked before .NET 7 making the change both non-binary and non-source breaking[1].Proposed API
Usage Examples
Alternative Designs
Single(connectionId)
method and addnew Caller
andnew Client
.Single(connectionId)
being the only way to get client return results.Risks
IHubClients
and added avoid Single(string whatever)
, that would be source breaking. I don't think anyone has done this though. I also don't think anyone is doing anything like the following which would still technically be source breaking:But that involves using the returned type of
Caller
orClient(connectionId)
to infer a non-covariant type. The above example is the easiest way I can think of doing this, but I don't think anyone does this in practice.The text was updated successfully, but these errors were encountered: