Interface GrpcService
-
public interface GrpcServiceA Helidon gRPC service.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> voidcomplete(io.grpc.stub.StreamObserver<T> observer, Runnable task, T result)Execute aRunnabletask and on completion of the task complete the gRPC request by callingStreamObserver.onNext(Object)using the specified result and then callStreamObserver.onCompleted().default <T> voidcomplete(io.grpc.stub.StreamObserver<T> observer, Callable<T> callable)Complete a gRPC request based on the result of aCallable.default <T> voidcomplete(io.grpc.stub.StreamObserver<T> observer, CompletionStage<T> future)Complete a gRPC request based on the result of aCompletionStage.default <T> voidcomplete(io.grpc.stub.StreamObserver<T> observer, T value)Complete a gRPC request.default <T> voidcompleteAsync(io.grpc.stub.StreamObserver<T> observer, Runnable task, T result)Asynchronously execute aRunnabletask and on completion of the task complete the gRPC request by callingStreamObserver.onNext(Object)using the specified result and then callStreamObserver.onCompleted().default <T> voidcompleteAsync(io.grpc.stub.StreamObserver<T> observer, Runnable task, T result, Executor executor)Asynchronously execute aRunnabletask and on completion of the task complete the gRPC request by callingStreamObserver.onNext(Object)using the specified result and then callStreamObserver.onCompleted().default <T> voidcompleteAsync(io.grpc.stub.StreamObserver<T> observer, Callable<T> callable)Asynchronously complete a gRPC request based on the result of aCallable.default <T> voidcompleteAsync(io.grpc.stub.StreamObserver<T> observer, Callable<T> callable, Executor executor)Asynchronously complete a gRPC request based on the result of aCallable.default <T> voidcompleteAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<T> future)Asynchronously complete a gRPC request based on the result of aCompletionStage.default <T> voidcompleteAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<T> future, Executor executor)Asynchronously complete a gRPC request based on the result of aCompletionStage.default Stringname()Obtain the name of this service.default <T> Consumer<T>stream(io.grpc.stub.StreamObserver<T> observer, CompletionStage<Void> stage)Obtain aConsumerthat can be used to send values to theStreamObserver.onNext(Object)method until theCompletionStagecompletes then callStreamObserver.onCompleted().default <T> voidstream(io.grpc.stub.StreamObserver<T> observer, Supplier<Stream<? extends T>> supplier)default <T> voidstream(io.grpc.stub.StreamObserver<T> observer, Stream<? extends T> stream)default <T> Consumer<T>streamAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<Void> stage)Obtain aConsumerthat can be used to send values to theStreamObserver.onNext(Object)method until theCompletionStagecompletes then asynchronously callStreamObserver.onCompleted()using the fork-join thread pool.default <T> Consumer<T>streamAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<Void> stage, Executor executor)Obtain aConsumerthat can be used to send values to theStreamObserver.onNext(Object)method until theCompletionStagecompletes then asynchronously callStreamObserver.onCompleted()using the executor thread.default <T> voidstreamAsync(io.grpc.stub.StreamObserver<T> observer, Supplier<Stream<? extends T>> supplier, Executor executor)default <T> voidstreamAsync(io.grpc.stub.StreamObserver<T> observer, Stream<? extends T> stream, Executor executor)voidupdate(ServiceDescriptor.Rules rules)Update service configuration.
-
-
-
Method Detail
-
update
void update(ServiceDescriptor.Rules rules)
Update service configuration.- Parameters:
rules- configuration to update
-
name
default String name()
Obtain the name of this service.The default implementation returns the implementation class's
Class.getSimpleName().- Returns:
- the name of this service
-
complete
default <T> void complete(io.grpc.stub.StreamObserver<T> observer, T value)Complete a gRPC request.The request will be completed by calling
StreamObserver.onNext(Object)using the specified value then callingStreamObserver.onCompleted().- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completevalue- the value to use when callingStreamObserver.onNext(Object)
-
complete
default <T> void complete(io.grpc.stub.StreamObserver<T> observer, CompletionStage<T> future)Complete a gRPC request based on the result of aCompletionStage.The request will be completed by calling
StreamObserver.onNext(Object)using the result obtained on completion of the specifiedCompletionStageand then callingStreamObserver.onCompleted().If the
CompletionStagecompletes with an error thenStreamObserver.onError(Throwable)will be called.- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completefuture- theCompletionStageto use to obtain the value to use to callStreamObserver.onNext(Object)
-
completeAsync
default <T> void completeAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<T> future)Asynchronously complete a gRPC request based on the result of aCompletionStage.The request will be completed by calling
StreamObserver.onNext(Object)using the result obtained on completion of the specifiedCompletionStageand then callingStreamObserver.onCompleted().If the
CompletionStagecompletes with an error thenStreamObserver.onError(Throwable)will be called.The execution will take place asynchronously on the fork-join thread pool.
- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completefuture- theCompletionStageto use to obtain the value to use to callStreamObserver.onNext(Object)
-
completeAsync
default <T> void completeAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<T> future, Executor executor)Asynchronously complete a gRPC request based on the result of aCompletionStage.The request will be completed by calling
StreamObserver.onNext(Object)using the result obtained on completion of the specifiedCompletionStageand then callingStreamObserver.onCompleted().If the
CompletionStagecompletes with an error thenStreamObserver.onError(Throwable)will be called.- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completefuture- theCompletionStageto use to obtain the value to use to callStreamObserver.onNext(Object)executor- theExecutoron which to execute the asynchronous request completion
-
complete
default <T> void complete(io.grpc.stub.StreamObserver<T> observer, Callable<T> callable)Complete a gRPC request based on the result of aCallable.The request will be completed by calling
StreamObserver.onNext(Object)using the result obtained on completion of the specifiedCallableand then callingStreamObserver.onCompleted().If the
Callable.call()method throws an exception thenStreamObserver.onError(Throwable)will be called.- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completecallable- theCallableto use to obtain the value to use to callStreamObserver.onNext(Object)
-
completeAsync
default <T> void completeAsync(io.grpc.stub.StreamObserver<T> observer, Callable<T> callable)Asynchronously complete a gRPC request based on the result of aCallable.The request will be completed by calling
StreamObserver.onNext(Object)using the result obtained on completion of the specifiedCallableand then callingStreamObserver.onCompleted().If the
Callable.call()method throws an exception thenStreamObserver.onError(Throwable)will be called.The execution will take place asynchronously on the fork-join thread pool.
- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completecallable- theCallableto use to obtain the value to use to callStreamObserver.onNext(Object)
-
completeAsync
default <T> void completeAsync(io.grpc.stub.StreamObserver<T> observer, Callable<T> callable, Executor executor)Asynchronously complete a gRPC request based on the result of aCallable.The request will be completed by calling
StreamObserver.onNext(Object)using the result obtained on completion of the specifiedCallableand then callingStreamObserver.onCompleted().If the
Callable.call()method throws an exception thenStreamObserver.onError(Throwable)will be called.
-
complete
default <T> void complete(io.grpc.stub.StreamObserver<T> observer, Runnable task, T result)Execute aRunnabletask and on completion of the task complete the gRPC request by callingStreamObserver.onNext(Object)using the specified result and then callStreamObserver.onCompleted().If the
Runnable.run()method throws an exception thenStreamObserver.onError(Throwable)will be called.- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completetask- theRunnableto executeresult- the result to pass toStreamObserver.onNext(Object)
-
completeAsync
default <T> void completeAsync(io.grpc.stub.StreamObserver<T> observer, Runnable task, T result)Asynchronously execute aRunnabletask and on completion of the task complete the gRPC request by callingStreamObserver.onNext(Object)using the specified result and then callStreamObserver.onCompleted().If the
Runnable.run()method throws an exception thenStreamObserver.onError(Throwable)will be called.The task and and request completion will be executed on the fork-join thread pool.
- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completetask- theRunnableto executeresult- the result to pass toStreamObserver.onNext(Object)
-
completeAsync
default <T> void completeAsync(io.grpc.stub.StreamObserver<T> observer, Runnable task, T result, Executor executor)Asynchronously execute aRunnabletask and on completion of the task complete the gRPC request by callingStreamObserver.onNext(Object)using the specified result and then callStreamObserver.onCompleted().If the
Runnable.run()method throws an exception thenStreamObserver.onError(Throwable)will be called.
-
stream
default <T> void stream(io.grpc.stub.StreamObserver<T> observer, Stream<? extends T> stream)Send the values from aStreamto theStreamObserver.onNext(Object)method until theStreamis exhausted callStreamObserver.onCompleted().If an error occurs whilst streaming results then
StreamObserver.onError(Throwable)will be called.- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto completestream- theStreamof results to send toStreamObserver.onNext(Object)
-
streamAsync
default <T> void streamAsync(io.grpc.stub.StreamObserver<T> observer, Stream<? extends T> stream, Executor executor)
-
stream
default <T> void stream(io.grpc.stub.StreamObserver<T> observer, Supplier<Stream<? extends T>> supplier)
-
streamAsync
default <T> void streamAsync(io.grpc.stub.StreamObserver<T> observer, Supplier<Stream<? extends T>> supplier, Executor executor)
-
stream
default <T> Consumer<T> stream(io.grpc.stub.StreamObserver<T> observer, CompletionStage<Void> stage)
Obtain aConsumerthat can be used to send values to theStreamObserver.onNext(Object)method until theCompletionStagecompletes then callStreamObserver.onCompleted().If the
CompletionStagecompletes with an error thenStreamObserver.onError(Throwable)will be called instead ofStreamObserver.onCompleted().- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto send values to and complete when theCompletionStagecompletesstage- theCompletionStageto await completion of- Returns:
- a
Consumerthat can be used to send values to theStreamObserver.onNext(Object)method
-
streamAsync
default <T> Consumer<T> streamAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<Void> stage)
Obtain aConsumerthat can be used to send values to theStreamObserver.onNext(Object)method until theCompletionStagecompletes then asynchronously callStreamObserver.onCompleted()using the fork-join thread pool.If the
CompletionStagecompletes with an error thenStreamObserver.onError(Throwable)will be called instead ofStreamObserver.onCompleted().- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto send values to and complete when theCompletionStagecompletesstage- theCompletionStageto await completion of- Returns:
- a
Consumerthat can be used to send values to theStreamObserver.onNext(Object)method
-
streamAsync
default <T> Consumer<T> streamAsync(io.grpc.stub.StreamObserver<T> observer, CompletionStage<Void> stage, Executor executor)
Obtain aConsumerthat can be used to send values to theStreamObserver.onNext(Object)method until theCompletionStagecompletes then asynchronously callStreamObserver.onCompleted()using the executor thread.If the
CompletionStagecompletes with an error thenStreamObserver.onError(Throwable)will be called instead ofStreamObserver.onCompleted().- Type Parameters:
T- they type of the request result- Parameters:
observer- theStreamObserverto send values to and complete when theCompletionStagecompletesstage- theCompletionStageto await completion ofexecutor- theExecutoron which to execute the asynchronous request completion- Returns:
- a
Consumerthat can be used to send values to theStreamObserver.onNext(Object)method
-
-