Java supports client results (#28147)

pull/28176/head
Brennan 2023-01-23 16:12:35 -08:00 committed by GitHub
parent d20cc8ecd7
commit e38284cba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -40,7 +40,7 @@ The table below shows the features and support for the clients that offer real-t
| Long Polling Transport |2.1.0|1.0.0|1.0.0|3.0.0|
| JSON Hub Protocol |2.1.0|1.0.0|1.0.0|1.0.0|
| MessagePack Hub Protocol |2.1.0|1.0.0|1.0.0|5.0.0|
| Client Results |7.0.0|7.0.0|7.0.0||
| Client Results |7.0.0|7.0.0|7.0.0|7.0.0|
Support for enabling additional client features is tracked in [our issue tracker](https://github.com/dotnet/AspNetCore/issues).

View File

@ -689,6 +689,14 @@ hubConnection.on("GetMessage", async () => {
});
```
#### Java client
```java
hubConnection.onWithResult("GetMessage", () -> {
return Single.just("message");
});
```
## Change the name of a hub method
By default, a server hub method name is the name of the .NET method. To change this default behavior for a specific method, use the [HubMethodName](xref:Microsoft.AspNetCore.SignalR.HubMethodNameAttribute) attribute. The client should use this name instead of the .NET method name when invoking the method: