Top Description Fields Constructors Methods
io.rsocket.core

pack-priv Class RSocketClientAdapter

extends Object
implements RSocketClient
Class Inheritance
All Implemented Interfaces
io.rsocket.core.RSocketClient, io.rsocket.Closeable, reactor.core.Disposable
Imports
io.rsocket.Payload, .RSocket, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono

Simple adapter from RSocket to RSocketClient. This is useful in code that needs to deal with both in the same way. When connecting to a server, typically RSocketClient is expected to be used, but in a responder (client or server), it is necessary to interact with RSocket to make requests to the remote end.
Since
1.1

Field Summary

Modifier and TypeField and Description
private final RSocket

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
connect()

Overrides default io.rsocket.core.RSocketClient.connect.

Connect to the remote rsocket endpoint, if not yet connected.
public void
dispose()

Implements reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.
public Mono<Void>
fireAndForget(Mono<Payload> payloadMono)

Implements io.rsocket.core.RSocketClient.fireAndForget.

Perform a Fire-and-Forget interaction via RSocket#fireAndForget(Payload).
public Mono<Void>
public Mono<Void>
onClose()

Overrides default io.rsocket.core.RSocketClient.onClose.

Returns a Mono that terminates when the instance is terminated by any reason.
public Flux<Payload>
public Mono<Payload>
requestResponse(Mono<Payload> payloadMono)

Implements io.rsocket.core.RSocketClient.requestResponse.

Perform a Request-Response interaction via RSocket#requestResponse(Payload).
public Flux<Payload>
requestStream(Mono<Payload> payloadMono)

Implements io.rsocket.core.RSocketClient.requestStream.

Perform a Request-Stream interaction via RSocket#requestStream(Payload).
public RSocket
public Mono<RSocket>
source()

Implements io.rsocket.core.RSocketClient.source.

Return the underlying source used to obtain a shared RSocket connection.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rsocketback to summary
private final RSocket rsocket

Constructor Detail

RSocketClientAdapterback to summary
public RSocketClientAdapter(RSocket rsocket)

Method Detail

connectback to summary
public boolean connect()

Overrides default io.rsocket.core.RSocketClient.connect.

Doc from io.rsocket.core.RSocketClient.connect.

Connect to the remote rsocket endpoint, if not yet connected. This method is a shortcut for RSocketClient#source().subscribe().

Returns:boolean

true if an attempt to connect was triggered or if already connected, or false if the client is terminated.

Annotations
@Override
disposeback to summary
public void dispose()

Implements reactor.core.Disposable.dispose.

Doc from reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.

Implementations are required to make this method idempotent.

Annotations
@Override
fireAndForgetback to summary
public Mono<Void> fireAndForget(Mono<Payload> payloadMono)

Implements io.rsocket.core.RSocketClient.fireAndForget.

Doc from io.rsocket.core.RSocketClient.fireAndForget.

Perform a Fire-and-Forget interaction via RSocket#fireAndForget(Payload). Allows multiple subscriptions and performs a request per subscriber.

Annotations
@Override
metadataPushback to summary
public Mono<Void> metadataPush(Mono<Payload> payloadMono)

Implements io.rsocket.core.RSocketClient.metadataPush.

Doc from io.rsocket.core.RSocketClient.metadataPush.

Perform a Metadata Push via RSocket#metadataPush(Payload). Allows multiple subscriptions and performs a request per subscriber.

Annotations
@Override
onCloseback to summary
public Mono<Void> onClose()

Overrides default io.rsocket.core.RSocketClient.onClose.

Doc from io.rsocket.Closeable.onClose.

Returns a Mono that terminates when the instance is terminated by any reason. Note, in case of error termination, the cause of error will be propagated as an error signal through org.reactivestreams.Subscriber#onError(Throwable). Otherwise, Subscriber#onComplete() will be called.

Returns:Mono<Void>

a Mono to track completion with success or error of the underlying resource. When the underlying resource is an `RSocket`, the Mono exposes stream 0 (i.e. connection level) errors.

Annotations
@Override
requestChannelback to summary
public Flux<Payload> requestChannel(Publisher<Payload> payloads)

Implements io.rsocket.core.RSocketClient.requestChannel.

Doc from io.rsocket.core.RSocketClient.requestChannel.

Perform a Request-Channel interaction via RSocket#requestChannel(Publisher). Allows multiple subscriptions and performs a request per subscriber.

Annotations
@Override
requestResponseback to summary
public Mono<Payload> requestResponse(Mono<Payload> payloadMono)

Implements io.rsocket.core.RSocketClient.requestResponse.

Doc from io.rsocket.core.RSocketClient.requestResponse.

Perform a Request-Response interaction via RSocket#requestResponse(Payload). Allows multiple subscriptions and performs a request per subscriber.

Annotations
@Override
requestStreamback to summary
public Flux<Payload> requestStream(Mono<Payload> payloadMono)

Implements io.rsocket.core.RSocketClient.requestStream.

Doc from io.rsocket.core.RSocketClient.requestStream.

Perform a Request-Stream interaction via RSocket#requestStream(Payload). Allows multiple subscriptions and performs a request per subscriber.

Annotations
@Override
rsocketback to summary
public RSocket rsocket()
sourceback to summary
public Mono<RSocket> source()

Implements io.rsocket.core.RSocketClient.source.

Doc from io.rsocket.core.RSocketClient.source.

Return the underlying source used to obtain a shared RSocket connection.

Annotations
@Override