Class WebsocketGatewayClient
- java.lang.Object
-
- io.scalecube.services.gateway.transport.websocket.WebsocketGatewayClient
-
- All Implemented Interfaces:
GatewayClient
public final class WebsocketGatewayClient extends Object implements GatewayClient
-
-
Constructor Summary
Constructors Constructor Description WebsocketGatewayClient(GatewayClientSettings settings, GatewayClientCodec<io.netty.buffer.ByteBuf> codec)Creates instance of websocket client transport.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Initiate cleaning of underlying resources (if any) like closing websocket connection or rSocket session.GatewayClientCodec<io.netty.buffer.ByteBuf>getCodec()reactor.core.publisher.Mono<Void>onClose()Return close completion signal of the gateway client.reactor.core.publisher.Flux<io.scalecube.services.api.ServiceMessage>requestChannel(reactor.core.publisher.Flux<io.scalecube.services.api.ServiceMessage> requests)Communication mode that gives stream of responses to stream of requests.reactor.core.publisher.Mono<io.scalecube.services.api.ServiceMessage>requestResponse(io.scalecube.services.api.ServiceMessage request)Communication mode that gives single response to single request.reactor.core.publisher.Flux<io.scalecube.services.api.ServiceMessage>requestStream(io.scalecube.services.api.ServiceMessage request)Communication mode that gives stream of responses to single request.
-
-
-
Constructor Detail
-
WebsocketGatewayClient
public WebsocketGatewayClient(GatewayClientSettings settings, GatewayClientCodec<io.netty.buffer.ByteBuf> codec)
Creates instance of websocket client transport.- Parameters:
settings- client settingscodec- client codec.
-
-
Method Detail
-
requestResponse
public reactor.core.publisher.Mono<io.scalecube.services.api.ServiceMessage> requestResponse(io.scalecube.services.api.ServiceMessage request)
Description copied from interface:GatewayClientCommunication mode that gives single response to single request.- Specified by:
requestResponsein interfaceGatewayClient- Parameters:
request- request message.- Returns:
- Publisher that emits single response form remote server as it's ready.
-
requestStream
public reactor.core.publisher.Flux<io.scalecube.services.api.ServiceMessage> requestStream(io.scalecube.services.api.ServiceMessage request)
Description copied from interface:GatewayClientCommunication mode that gives stream of responses to single request.- Specified by:
requestStreamin interfaceGatewayClient- Parameters:
request- request message.- Returns:
- Publisher that emits responses from remote server.
-
requestChannel
public reactor.core.publisher.Flux<io.scalecube.services.api.ServiceMessage> requestChannel(reactor.core.publisher.Flux<io.scalecube.services.api.ServiceMessage> requests)
Description copied from interface:GatewayClientCommunication mode that gives stream of responses to stream of requests.- Specified by:
requestChannelin interfaceGatewayClient- Parameters:
requests- request stream.- Returns:
- Publisher that emits responses from remote server.
-
close
public void close()
Description copied from interface:GatewayClientInitiate cleaning of underlying resources (if any) like closing websocket connection or rSocket session. Subsequent calls of requestOne() or requestMany() must issue new connection creation. Note that close is not the end of client lifecycle.- Specified by:
closein interfaceGatewayClient
-
onClose
public reactor.core.publisher.Mono<Void> onClose()
Description copied from interface:GatewayClientReturn close completion signal of the gateway client.- Specified by:
onClosein interfaceGatewayClient- Returns:
- close completion signal
-
getCodec
public GatewayClientCodec<io.netty.buffer.ByteBuf> getCodec()
-
-