Top Description Methods
io.rsocket

public Interface SocketAcceptor

Imports
io.rsocket.exceptions.SetupException, java.util.function.Function, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono

RSocket is a full duplex protocol where a client and server are identical in terms of both having the capability to initiate requests to their peer. This interface provides the contract where a client or server handles the setup for a new connection and creates a responder RSocket for accepting requests from the remote peer.

Method Summary

Modifier and TypeMethod and Description
public Mono<RSocket>

Returns:

RSocket to accept requests with.
accept
(ConnectionSetupPayload
the setup received from a client in a server scenario, or in a client scenario this is the setup about to be sent to the server.
setup
,
RSocket
socket for sending requests to the remote peer.
sendingSocket
)

Handle the SETUP frame for a new connection and create a responder RSocket for handling requests from the remote peer.

public static SocketAcceptor
forFireAndForget(Function<Payload, Mono<Void>> handler)

Create a SocketAcceptor for fire-and-forget interactions with the given handler.

public static SocketAcceptor
forRequestChannel(Function<Publisher<Payload>, Flux<Payload>> handler)

Create a SocketAcceptor for request-channel interactions with the given handler.

public static SocketAcceptor
forRequestResponse(Function<Payload, Mono<Payload>> handler)

Create a SocketAcceptor for request-response interactions with the given handler.

public static SocketAcceptor
forRequestStream(Function<Payload, Flux<Payload>> handler)

Create a SocketAcceptor for request-stream interactions with the given handler.

public static SocketAcceptor
with(RSocket rsocket)

Create a SocketAcceptor that handles requests with the given RSocket.

Method Detail

acceptback to summary
public Mono<RSocket> accept(ConnectionSetupPayload setup, RSocket sendingSocket)

Handle the SETUP frame for a new connection and create a responder RSocket for handling requests from the remote peer.

Parameters
setup:ConnectionSetupPayload

the setup received from a client in a server scenario, or in a client scenario this is the setup about to be sent to the server.

sendingSocket:RSocket

socket for sending requests to the remote peer.

Returns:Mono<RSocket>

RSocket to accept requests with.

Exceptions
SetupException:
If the acceptor needs to reject the setup of this socket.
forFireAndForgetback to summary
public static SocketAcceptor forFireAndForget(Function<Payload, Mono<Void>> handler)

Create a SocketAcceptor for fire-and-forget interactions with the given handler.

forRequestChannelback to summary
public static SocketAcceptor forRequestChannel(Function<Publisher<Payload>, Flux<Payload>> handler)

Create a SocketAcceptor for request-channel interactions with the given handler.

forRequestResponseback to summary
public static SocketAcceptor forRequestResponse(Function<Payload, Mono<Payload>> handler)

Create a SocketAcceptor for request-response interactions with the given handler.

forRequestStreamback to summary
public static SocketAcceptor forRequestStream(Function<Payload, Flux<Payload>> handler)

Create a SocketAcceptor for request-stream interactions with the given handler.

withback to summary
public static SocketAcceptor with(RSocket rsocket)

Create a SocketAcceptor that handles requests with the given RSocket.