Skip to content

Commit 1eafd63

Browse files
OlegDokukarobertroeser
authored andcommitted
enhance RequestHandlingRSocket for more flexible usage as a builder for adding services (#23)
1 parent 9268bf6 commit 1eafd63

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

rsocket-rpc-core/src/main/java/io/rsocket/rpc/rsocket/RequestHandlingRSocket.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,21 @@ public RequestHandlingRSocket(RSocketRpcService... services) {
2525
}
2626
}
2727

28+
/**
29+
* @deprecated in favour of {@link #withService(RSocketRpcService)}
30+
* @param rsocketService
31+
*/
32+
@Deprecated
2833
public void addService(RSocketRpcService rsocketService) {
2934
String service = rsocketService.getService();
3035
registeredServices.put(service, rsocketService);
3136
}
3237

38+
public RequestHandlingRSocket withService(RSocketRpcService rSocketRpcService) {
39+
addService(rSocketRpcService);
40+
return this;
41+
}
42+
3343
@Override
3444
public Mono<Void> fireAndForget(Payload payload) {
3545
try {

0 commit comments

Comments
 (0)