Package io.vertx.rxjava.grpcio.client
Class GrpcIoClient
- java.lang.Object
-
- io.vertx.rxjava.grpc.client.GrpcClient
-
- io.vertx.rxjava.grpcio.client.GrpcIoClient
-
- All Implemented Interfaces:
RxDelegate
public class GrpcIoClient extends GrpcClient implements RxDelegate
Extends the so it can be utilized with .
In Vert.x 5, the core is decoupled from `io.grpc.*` packages to support JPMS.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<GrpcIoClient>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description GrpcIoClient(GrpcIoClient delegate)
GrpcIoClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <Req,Resp,T>
Future<T>call(SocketAddress server, io.grpc.MethodDescriptor<Req,Resp> service, Handler<GrpcClientRequest<Req,Resp>> requestHandler, Function<GrpcClientResponse<Req,Resp>,Future<T>> resultFn)
Call theservice
gRPC service hosted byserver
.static GrpcIoClient
client(Vertx vertx)
Create a new clientstatic GrpcIoClient
client(Vertx vertx, HttpClientOptions options)
Create a new clientstatic GrpcIoClient
client(Vertx vertx, GrpcClientOptions options)
Create a new clientboolean
equals(Object o)
GrpcIoClient
getDelegate()
int
hashCode()
static GrpcIoClient
newInstance(GrpcIoClient arg)
<Req,Resp,T>
rx.Single<T>rxCall(SocketAddress server, io.grpc.MethodDescriptor<Req,Resp> service, Handler<GrpcClientRequest<Req,Resp>> requestHandler, Function<GrpcClientResponse<Req,Resp>,Future<T>> resultFn)
Call theservice
gRPC service hosted byserver
.String
toString()
-
Methods inherited from class io.vertx.rxjava.grpc.client.GrpcClient
close, newInstance, request, request, request, rxClose, rxRequest, rxRequest, rxRequest
-
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<GrpcIoClient> __TYPE_ARG
-
-
Constructor Detail
-
GrpcIoClient
public GrpcIoClient(GrpcIoClient delegate)
-
GrpcIoClient
public GrpcIoClient(Object delegate)
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classGrpcClient
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classGrpcClient
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classGrpcClient
-
getDelegate
public GrpcIoClient getDelegate()
- Specified by:
getDelegate
in interfaceRxDelegate
- Overrides:
getDelegate
in classGrpcClient
-
client
public static GrpcIoClient client(Vertx vertx)
Create a new client- Parameters:
vertx
- the vertx instance- Returns:
- the created client
-
client
public static GrpcIoClient client(Vertx vertx, GrpcClientOptions options)
Create a new client- Parameters:
vertx
- the vertx instanceoptions
-- Returns:
- the created client
-
client
public static GrpcIoClient client(Vertx vertx, HttpClientOptions options)
Create a new client- Parameters:
vertx
- the vertx instanceoptions
- the client options- Returns:
- the created client
-
call
public <Req,Resp,T> Future<T> call(SocketAddress server, io.grpc.MethodDescriptor<Req,Resp> service, Handler<GrpcClientRequest<Req,Resp>> requestHandler, Function<GrpcClientResponse<Req,Resp>,Future<T>> resultFn)
Call theservice
gRPC service hosted byserver
.The
requestHandler
is called to send the request, e.g.req -> req.send(item)
The
responseFunction
extracts the result, e.g.resp -> resp.last()
It can be used in various ways:
Future
fut = client.call(..., req -> req.send(item), resp -> resp.last()); Future
fut = client.call(..., req -> req.send(stream), resp -> resp.pipeTo(anotherService)); Future
- > fut = client.call(..., req -> req.send(stream), resp -> resp.collecting(Collectors.toList()));
- Overrides:
call
in classGrpcClient
- Parameters:
server
- the server hosting the serviceservice
- the service to callrequestHandler
- the handler called to send the requestresultFn
- the function applied to extract the result.- Returns:
- a future of the result
-
rxCall
public <Req,Resp,T> rx.Single<T> rxCall(SocketAddress server, io.grpc.MethodDescriptor<Req,Resp> service, Handler<GrpcClientRequest<Req,Resp>> requestHandler, Function<GrpcClientResponse<Req,Resp>,Future<T>> resultFn)
Call theservice
gRPC service hosted byserver
.The
requestHandler
is called to send the request, e.g.req -> req.send(item)
The
responseFunction
extracts the result, e.g.resp -> resp.last()
It can be used in various ways:
Future
fut = client.call(..., req -> req.send(item), resp -> resp.last()); Future
fut = client.call(..., req -> req.send(stream), resp -> resp.pipeTo(anotherService)); Future
- > fut = client.call(..., req -> req.send(stream), resp -> resp.collecting(Collectors.toList()));
- Overrides:
rxCall
in classGrpcClient
- Parameters:
server
- the server hosting the serviceservice
- the service to callrequestHandler
- the handler called to send the requestresultFn
- the function applied to extract the result.- Returns:
- a future of the result
-
newInstance
public static GrpcIoClient newInstance(GrpcIoClient arg)
-
-