@@ -33,7 +33,10 @@ public interface RSocket extends Availability, Closeable {
3333 * @return {@code Publisher} that completes when the passed {@code payload} is successfully
3434 * handled, otherwise errors.
3535 */
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+ }
3740
3841 /**
3942 * Request-Response interaction model of {@code RSocket}.
@@ -42,23 +45,31 @@ public interface RSocket extends Availability, Closeable {
4245 * @return {@code Publisher} containing at most a single {@code Payload} representing the
4346 * response.
4447 */
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+ }
4652
4753 /**
4854 * Request-Stream interaction model of {@code RSocket}.
4955 *
5056 * @param payload Request payload.
5157 * @return {@code Publisher} containing the stream of {@code Payload}s representing the response.
5258 */
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+ }
5463
5564 /**
5665 * Request-Channel interaction model of {@code RSocket}.
5766 *
5867 * @param payloads Stream of request payloads.
5968 * @return Stream of response payloads.
6069 */
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+ }
6273
6374 /**
6475 * Metadata-Push interaction model of {@code RSocket}.
@@ -67,10 +78,26 @@ public interface RSocket extends Availability, Closeable {
6778 * @return {@code Publisher} that completes when the passed {@code payload} is successfully
6879 * handled, otherwise errors.
6980 */
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+ }
7185
7286 @ Override
7387 default double availability () {
7488 return isDisposed () ? 0.0 : 1.0 ;
7589 }
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+ }
76103}
0 commit comments