Package ai.pipestream.common.grpc
Interface GrpcClientFactory
- All Known Implementing Classes:
DynamicGrpcClientFactory
public interface GrpcClientFactory
Interface for dynamic gRPC client creation and management.
-
Method Summary
Modifier and TypeMethodDescriptionvoidevictChannel(String serviceName) Evict (close) a cached channel for a service to force reconnection.intGet the number of active service connections being managed.Get cache statistics for debugging and monitoring.io.smallrye.mutiny.Uni<io.grpc.Channel> getChannel(String serviceName) Get a raw Channel for advanced use cases.<T extends io.quarkus.grpc.MutinyStub>
io.smallrye.mutiny.Uni<T> Get a typed Mutiny stub using a method reference (zero reflection).
-
Method Details
-
getClient
<T extends io.quarkus.grpc.MutinyStub> io.smallrye.mutiny.Uni<T> getClient(String serviceName, Function<io.grpc.Channel, T> stubCreator) Get a typed Mutiny stub using a method reference (zero reflection).- Type Parameters:
T- The Mutiny stub type (must extend MutinyStub)- Parameters:
serviceName- The logical service name for discoverystubCreator- Method reference to create stub (e.g., MutinyFooServiceGrpc::newMutinyStub)- Returns:
- A Uni emitting the typed Stub
-
getChannel
Get a raw Channel for advanced use cases.- Parameters:
serviceName- The logical service name for discovery- Returns:
- A Uni emitting the Channel
-
getActiveServiceCount
int getActiveServiceCount()Get the number of active service connections being managed. -
evictChannel
Evict (close) a cached channel for a service to force reconnection. -
getCacheStats
String getCacheStats()Get cache statistics for debugging and monitoring.
-