-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[API] Add client result support to Java client #41777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API review notes:
package com.microsoft.signalr;
+ public interface ActionCompletable {
+ Completable invoke();
+ }
+ public interface Action1Completable<T1> {
+ Completable invoke(T1 param1);
+ }
// Up to 8
+ Action8Completable<T1, ..., T8> package com.microsoft.signalr;
+ public interface Function<TResult> {
+ T invoke();
+ }
+ public interface FunctionSingle<TResult> {
+ Single<TResult> invoke();
+ }
+ public interface Function1<T1, TResult> {
+ TResult invoke(T1 param1);
+ }
+ public interface Function1Single<T1, TResult> {
+ Single<TResult> invoke(T1 param1);
+ }
// Up to 8
+ Function8Single<T1, ..., T8, TResult> package com.microsoft.signalr;
class HubConnection {
+ public Subscription on(String target, ActionCompletable callback);
+ public <TResult> Subscription on(String target, Function<TResult> callback);
+ public <TResult> Subscription on(String target, FunctionSingle<TResult> callback);
+ public <T1> Subscription on(String target, Action1Completable<T1> callback, Class<T1> param1);
+ public <T1, TResult> Subscription on(String target, Function1<T1, TResult> callback, Class<T1> param1);
+ public <T1, TResult> Subscription on(String target, Function1Single<T1, TResult> callback, Class<T1> param1);
// Up to 8
+ public <T1, ..., T8> Subscription on(String target, Action8Completable<T1, ..., T8> callback, Class<T1> param1, ..., Class<T8> param8);
+ public <T1, ..., T8, TResult> Subscription on(String target, Function8<T1, ..., T8, TResult> callback, Class<T1> param1, ..., Class<T8> param8);
+ public <T1, ..., T8, TResult> Subscription on(String target, FunctionSingle<T1, ..., T8, TResult> callback, Class<T1> param1, ..., Class<T8> param8);
} |
Because of how generics work in Java
The above is ambiguous. After discussion with Stephen, we think it would be best to rename the result returning New proposal is to add package com.microsoft.signalr;
+ public interface ActionCompletable {
+ Completable invoke();
+ }
+ public interface Action1Completable<T1> {
+ Completable invoke(T1 param1);
+ }
// Up to 8
+ Action8Completable<T1, ..., T8>
+ public interface FunctionSingle<TResult> {
+ Single<TResult> invoke();
+ }
+ public interface Function1Single<T1, TResult> {
+ Single<TResult> invoke(T1 param1);
+ }
// Up to 8
+ Function8Single<T1, ..., T8, TResult>
class HubConnection {
+ public Subscription on(String target, ActionCompletable callback);
+ public <TResult> Subscription onWithResult(String target, FunctionSingle<TResult> callback);
+ public <T1> Subscription on(String target, Action1Completable<T1> callback, Class<T1> param1);
+ public <T1, TResult> Subscription onWithResult(String target, Function1Single<T1, TResult> callback, Class<T1> param1);
// Up to 8
+ public <T1, ..., T8> Subscription on(String target, Action8Completable<T1, ..., T8> callback, Class<T1> param1, ..., Class<T8> param8);
+ public <T1, ..., T8, TResult> Subscription onWithResult(String target, FunctionSingle<T1, ..., T8, TResult> callback, Class<T1> param1, ..., Class<T8> param8);
} Alternatives would be to add an extra parameter to the new overloads which would basically do nothing except make it obvious to Java which overload to use.
|
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
API Review Notes:
API Approved! package com.microsoft.signalr;
+ public interface FunctionSingle<TResult> {
+ Single<TResult> invoke();
+ }
+ public interface Function1Single<T1, TResult> {
+ Single<TResult> invoke(T1 param1);
+ }
// Up to 8
+ Function8Single<T1, ..., T8, TResult>
class HubConnection {
+ public <TResult> Subscription onWithResult(String target, FunctionSingle<TResult> callback);
+ public <T1, TResult> Subscription onWithResult(String target, Function1Single<T1, TResult> callback, Class<T1> param1);
// Up to 8
+ public <T1, ..., T8, TResult> Subscription onWithResult(String target, FunctionSingle<T1, ..., T8, TResult> callback, Class<T1> param1, ..., Class<T8> param8);
} |
Done via #41774 |
Uh oh!
There was an error while loading. Please reload this page.
Background and Motivation
Adding async
.On
handlers for the SignalR Java client in order to better support client results.Adding
.On
overloads (and types) to support client results.Proposed API
Usage
The text was updated successfully, but these errors were encountered: