public interface SocketAcceptor
setup
for a new connection and creates a responder RSocket
for accepting requests from the remote peer.Modifier and Type | Method and Description |
---|---|
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. |
static SocketAcceptor |
forFireAndForget(Function<Payload,Mono<Void>> handler)
Create a
SocketAcceptor for fire-and-forget interactions with the given handler. |
static SocketAcceptor |
forRequestChannel(Function<org.reactivestreams.Publisher<Payload>,Flux<Payload>> handler)
Create a
SocketAcceptor for request-channel interactions with the given handler. |
static SocketAcceptor |
forRequestResponse(Function<Payload,Mono<Payload>> handler)
Create a
SocketAcceptor for request-response interactions with the given handler. |
static SocketAcceptor |
forRequestStream(Function<Payload,Flux<Payload>> handler)
Create a
SocketAcceptor for request-stream interactions with the given handler. |
static SocketAcceptor |
with(RSocket rsocket)
Create a
SocketAcceptor that handles requests with the given RSocket . |
Mono<RSocket> accept(ConnectionSetupPayload setup, RSocket sendingSocket)
SETUP
frame for a new connection and create a responder RSocket
for
handling requests from the remote peer.setup
- 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
- socket for sending requests to the remote peer.RSocket
to accept requests with.SetupException
- If the acceptor needs to reject the setup of this socket.static SocketAcceptor with(RSocket rsocket)
SocketAcceptor
that handles requests with the given RSocket
.static SocketAcceptor forFireAndForget(Function<Payload,Mono<Void>> handler)
SocketAcceptor
for fire-and-forget interactions with the given handler.static SocketAcceptor forRequestResponse(Function<Payload,Mono<Payload>> handler)
SocketAcceptor
for request-response interactions with the given handler.static SocketAcceptor forRequestStream(Function<Payload,Flux<Payload>> handler)
SocketAcceptor
for request-stream interactions with the given handler.static SocketAcceptor forRequestChannel(Function<org.reactivestreams.Publisher<Payload>,Flux<Payload>> handler)
SocketAcceptor
for request-channel interactions with the given handler.