@@ -33,7 +33,10 @@ public interface RSocket extends Availability, Closeable {
33
33
* @return {@code Publisher} that completes when the passed {@code payload} is successfully
34
34
* handled, otherwise errors.
35
35
*/
36
- Mono <Void > fireAndForget (Payload payload );
36
+ default Mono <Void > fireAndForget (Payload payload ) {
37
+ payload .release ();
38
+ return Mono .error (new UnsupportedOperationException ("Fire-and-Forget not implemented." ));
39
+ }
37
40
38
41
/**
39
42
* Request-Response interaction model of {@code RSocket}.
@@ -42,23 +45,31 @@ public interface RSocket extends Availability, Closeable {
42
45
* @return {@code Publisher} containing at most a single {@code Payload} representing the
43
46
* response.
44
47
*/
45
- Mono <Payload > requestResponse (Payload payload );
48
+ default Mono <Payload > requestResponse (Payload payload ) {
49
+ payload .release ();
50
+ return Mono .error (new UnsupportedOperationException ("Request-Response not implemented." ));
51
+ }
46
52
47
53
/**
48
54
* Request-Stream interaction model of {@code RSocket}.
49
55
*
50
56
* @param payload Request payload.
51
57
* @return {@code Publisher} containing the stream of {@code Payload}s representing the response.
52
58
*/
53
- Flux <Payload > requestStream (Payload payload );
59
+ default Flux <Payload > requestStream (Payload payload ) {
60
+ payload .release ();
61
+ return Flux .error (new UnsupportedOperationException ("Request-Stream not implemented." ));
62
+ }
54
63
55
64
/**
56
65
* Request-Channel interaction model of {@code RSocket}.
57
66
*
58
67
* @param payloads Stream of request payloads.
59
68
* @return Stream of response payloads.
60
69
*/
61
- Flux <Payload > requestChannel (Publisher <Payload > payloads );
70
+ default Flux <Payload > requestChannel (Publisher <Payload > payloads ) {
71
+ return Flux .error (new UnsupportedOperationException ("Request-Channel not implemented." ));
72
+ }
62
73
63
74
/**
64
75
* Metadata-Push interaction model of {@code RSocket}.
@@ -67,10 +78,26 @@ public interface RSocket extends Availability, Closeable {
67
78
* @return {@code Publisher} that completes when the passed {@code payload} is successfully
68
79
* handled, otherwise errors.
69
80
*/
70
- Mono <Void > metadataPush (Payload payload );
81
+ default Mono <Void > metadataPush (Payload payload ) {
82
+ payload .release ();
83
+ return Mono .error (new UnsupportedOperationException ("Metadata-Push not implemented." ));
84
+ }
71
85
72
86
@ Override
73
87
default double availability () {
74
88
return isDisposed () ? 0.0 : 1.0 ;
75
89
}
90
+
91
+ @ Override
92
+ default void dispose () {}
93
+
94
+ @ Override
95
+ default boolean isDisposed () {
96
+ return false ;
97
+ }
98
+
99
+ @ Override
100
+ default Mono <Void > onClose () {
101
+ return Mono .never ();
102
+ }
76
103
}
0 commit comments