-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversfeature-client-javaRelated to the SignalR Java clientRelated to the SignalR Java client
Milestone
Description
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
public interface Action1<T1> {
void invoke(T1 param1);
}
+ public interface Action1Completable<T1> {
+ Completable invoke(T1 param1);
+ }
//...
+ Action8Completable<T1, ..., T8>
+ public interface Function<T> {
+ T invoke();
+ }
+ public interface FunctionSingle<T> {
+ Single<T> invoke();
+ }
+ public interface Function1<T1, T> {
+ T invoke(T1 param1);
+ }
+ public interface Function1Single<T1, T> {
+ Single<T> invoke(T1 param1);
+ }
// Up to 8
class HubConnection {
+ public <T> Subscription on(String target, Function<T> callback);
+ public <T> Subscription on(String target, FunctionSingle<T> callback);
+ public <T1, T> Subscription on(String target, Function1<T1, T> callback, Class<T1> param1);
+ public <T1> Subscription on(String target, Action1Completable<T1> callback, Class<T1> param1);
// etc. to 8 args each
}
Usage
hubConnection.on("Send", () -> {
return Single.just(10);
});
hubConnection.on("Send", () -> {
return 10;
});
hubConnection.on("Send", () -> {
return Completable.Complete();
});
Metadata
Metadata
Assignees
Labels
DocsThis issue tracks updating documentationThis issue tracks updating documentationapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-signalrIncludes: SignalR clients and serversIncludes: SignalR clients and serversfeature-client-javaRelated to the SignalR Java clientRelated to the SignalR Java client